<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div>On Thu, Jul 18, 2019, at 08:13, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt"><div>Hi,<br></div><div><br></div><div>It is never NULL at the moment. But whether it can reasonably be NULL... I'd say it can if all resources were tracked by objres. So IMO, it's *not* a case for an assertion.<br></div></blockquote><div><br></div><div>OK<br></div><div><br></div><blockquote type="cite" id="qt"><div><br></div><div class="qt-gmail_quote"><div>Le 18 juillet 2019 08:51:08 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;" class="qt-gmail_quote"><pre class="qt-k9mail"><div><br></div><div><br></div><div>On Wed, Jul 17, 2019, at 22:26, Rémi Denis-Courmont wrote:<br></div><blockquote style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;" class="qt-gmail_quote"><div><hr> include/vlc_opengl.h | 1 +<br></div><div> modules/video_output/glx.c | 3 ++-<br></div><div> modules/video_output/opengl/egl.c | 5 +++--<br></div><div> modules/video_output/vgl.c | 5 +++--<br></div><div> modules/video_output/win32/wgl.c | 3 ++-<br></div><div> src/video_output/opengl.c | 11 ++---------<br></div><div> 6 files changed, 13 insertions(+), 15 deletions(-)<br></div><div><br></div><div>diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h<br></div><div>index 8c4909fc5d..4e436c939b 100644<br></div><div>--- a/include/vlc_opengl.h<br></div><div>+++ b/include/vlc_opengl.h<br></div><div>@@ -51,6 +51,7 @@ struct vlc_gl_t<br></div><div> void (*resize)(vlc_gl_t *, unsigned, unsigned);<br></div><div> void (*swap)(vlc_gl_t *);<br></div><div> void*(*getProcAddress)(vlc_gl_t *, const char *);<br></div><div>+ void (*destroy)(vlc_gl_t *);<br></div><div> <br></div><div> enum {<br></div><div> VLC_GL_EXT_DEFAULT,<br></div><div>diff --git a/modules/video_output/glx.c b/modules/video_output/glx.c<br></div><div>index d5d47c017a..9856c063a3 100644<br></div><div>--- a/modules/video_output/glx.c<br></div><div>+++ b/modules/video_output/glx.c<br></div><div>@@ -219,6 +219,7 @@ static int Open(vlc_gl_t *gl, unsigned width, <br></div><div>unsigned height)<br></div><div> gl->resize = NULL;<br></div><div> gl->swap = SwapBuffers;<br></div><div> gl->getProcAddress = GetSymbol;<br></div><div>+ gl->destroy = Close;<br></div><div> <br></div><div> bool is_swap_interval_set = false;<br></div><div> <br></div><div>@@ -271,5 +272,5 @@ vlc_module_begin ()<br></div><div> set_category (CAT_VIDEO)<br></div><div> set_subcategory (SUBCAT_VIDEO_VOUT)<br></div><div> set_capability ("opengl", 20)<br></div><div>- set_callbacks (Open, Close)<br></div><div>+ set_callbacks(Open, NULL)<br></div><div> vlc_module_end ()<br></div><div>diff --git a/modules/video_output/opengl/egl.c <br></div><div>b/modules/video_output/opengl/egl.c<br></div><div>index bd1b6941e4..b34ac06114 100644<br></div><div>--- a/modules/video_output/opengl/egl.c<br></div><div>+++ b/modules/video_output/opengl/egl.c<br></div><div>@@ -381,6 +381,7 @@ static int Open(vlc_gl_t *gl, const struct gl_api <br></div><div>*api,<br></div><div> gl->resize = Resize;<br></div><div> gl->swap = SwapBuffers;<br></div><div> gl->getProcAddress = GetSymbol;<br></div><div>+ gl->destroy = Close;<br></div><div> gl->egl.queryString = QueryString;<br></div><div> <br></div><div> sys->eglCreateImageKHR = (void *)eglGetProcAddress("eglCreateImageKHR");<br></div><div>@@ -422,12 +423,12 @@ vlc_module_begin ()<br></div><div> set_category (CAT_VIDEO)<br></div><div> set_subcategory (SUBCAT_VIDEO_VOUT)<br></div><div> set_capability ("opengl", 50)<br></div><div>- set_callbacks (OpenGL, Close)<br></div><div>+ set_callbacks(OpenGL, NULL)<br></div><div> add_shortcut ("egl")<br></div><div> <br></div><div> add_submodule ()<br></div><div> set_capability ("opengl es2", 50)<br></div><div>- set_callbacks (OpenGLES2, Close)<br></div><div>+ set_callbacks(OpenGLES2, NULL)<br></div><div> add_shortcut ("egl")<br></div><div> <br></div><div> vlc_module_end ()<br></div><div>diff --git a/modules/video_output/vgl.c b/modules/video_output/vgl.c<br></div><div>index c2c9be3696..e6825e19ac 100644<br></div><div>--- a/modules/video_output/vgl.c<br></div><div>+++ b/modules/video_output/vgl.c<br></div><div>@@ -129,6 +129,7 @@ static int Open(vlc_gl_t *gl, unsigned width, <br></div><div>unsigned height)<br></div><div> gl->resize = Resize;<br></div><div> gl->swap = VglSwapBuffers;<br></div><div> gl->getProcAddress = OurGetProcAddress;<br></div><div>+ gl->destroy = Close;<br></div><div> <br></div><div> if( sys->setupCb )<br></div><div> if( !sys->setupCb(sys->opaque) )<br></div><div>@@ -154,11 +155,11 @@ vlc_module_begin()<br></div><div> set_subcategory(SUBCAT_VIDEO_VOUT)<br></div><div> <br></div><div> set_capability("opengl", 0)<br></div><div>- set_callbacks(Open, Close)<br></div><div>+ set_callbacks(Open, NULL)<br></div><div> add_shortcut("vglmem")<br></div><div> <br></div><div> add_submodule()<br></div><div> set_capability("opengl es2", 0)<br></div><div>- set_callbacks(Open, Close)<br></div><div>+ set_callbacks(Open, NULL)<br></div><div> add_shortcut("vglmem")<br></div><div> vlc_module_end()<br></div><div>diff --git a/modules/video_output/win32/wgl.c <br></div><div>b/modules/video_output/win32/wgl.c<br></div><div>index 8f18424a8b..149149963f 100644<br></div><div>--- a/modules/video_output/win32/wgl.c<br></div><div>+++ b/modules/video_output/win32/wgl.c<br></div><div>@@ -49,7 +49,7 @@ vlc_module_begin()<br></div><div> add_integer("gpu-affinity", -1, HW_GPU_AFFINITY_TEXT, <br></div><div>HW_GPU_AFFINITY_TEXT, true)<br></div><div> <br></div><div> set_capability("opengl", 50)<br></div><div>- set_callbacks(Open, Close)<br></div><div>+ set_callbacks(Open, NULL)<br></div><div> add_shortcut("wgl")<br></div><div> vlc_module_end()<br></div><div> <br></div><div>@@ -235,6 +235,7 @@ static int Open(vlc_gl_t *gl, unsigned width, <br></div><div>unsigned height)<br></div><div> gl->resize = NULL;<br></div><div> gl->swap = Swap;<br></div><div> gl->getProcAddress = OurGetProcAddress;<br></div><div>+ gl->destroy = Close;<br></div><div> <br></div><div> if (sys->exts.GetExtensionsStringEXT || sys->exts.GetExtensionsStringARB)<br></div><div> gl->wgl.getExtensionsString = GetExtensionsString;<br></div><div>diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c<br></div><div>index f17c8ff05c..9d207ac709 100644<br></div><div>--- a/src/video_output/opengl.c<br></div><div>+++ b/src/video_output/opengl.c<br></div><div>@@ -52,14 +52,6 @@ static int vlc_gl_start(void *func, bool forced, va_list ap)<br></div><div> return ret;<br></div><div> }<br></div><div> <br></div><div>-static void vlc_gl_stop(void *func, va_list ap)<br></div><div>-{<br></div><div>- void (*deactivate)(vlc_gl_t *) = func;<br></div><div>- vlc_gl_t *gl = va_arg(ap, vlc_gl_t *);<br></div><div>-<br></div><div>- deactivate(gl);<br></div><div>-}<br></div><div>-<br></div><div> vlc_gl_t *vlc_gl_Create(const struct vout_display_cfg *restrict cfg,<br></div><div> unsigned flags, const char *name)<br></div><div> {<br></div><div>@@ -111,7 +103,8 @@ void vlc_gl_Release(vlc_gl_t *gl)<br></div><div> if (!vlc_atomic_rc_dec(&glpriv->rc))<br></div><div> return;<br></div><div> <br></div><div>- vlc_module_unload(gl->module, vlc_gl_stop, gl);<br></div><div>+ if (gl->destroy != NULL)<br></div><div>+ gl->destroy(gl);<br></div></blockquote><div><br></div><div>Can gl->destroy be NULL ? If not, I would have put an assert(gl->destroy)<br></div><div><br></div><blockquote style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;" class="qt-gmail_quote"><div> vlc_objres_clear(VLC_OBJECT(gl));<br></div><div> vlc_object_delete(gl);<br></div><div> }<br></div><div>-- <br></div><div>2.22.0<hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote></body></html>