<html><head></head><body>Hi,<br><br>I don't think that we require an object to be deleted after a single module probe though (unlike the kernel), or do we?<br><br><div class="gmail_quote">Le 27 janvier 2020 15:18:53 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Instead of clearing them from all kind of modules API.<br><br>This will allow to use vlc_obj_*alloc() from all modules without wondering if<br>resources will be cleaned. Indeed, some modules have their own close callbacks<br>that don't need module_unneed() (that was calling vlc_objres_clear()) to be<br>called to release them.<br><br>Furthermore, vlc_objres_clear() is an internal API, so submodules using an API<br>defined in modules and a close callback could not benefit from it.<hr> src/input/decoder_helpers.c | 1 -<br> src/misc/objects.c | 1 +<br> src/modules/modules.c | 2 --<br> src/network/tls.c | 2 --<br> src/video_output/display.c | 2 --<br> src/video_output/opengl.c | 1 -<br> src/video_output/window.c | 1 -<br> 7 files changed, 1 insertion(+), 9 deletions(-)<br><br>diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c<br>index e59cdcb3a10..ae022796336 100644<br>--- a/src/input/decoder_helpers.c<br>+++ b/src/input/decoder_helpers.c<br>@@ -222,7 +222,6 @@ vlc_decoder_device_Release(vlc_decoder_device *device)<br> {<br> if (device->ops->close != NULL)<br> device->ops->close(device);<br>- vlc_objres_clear(VLC_OBJECT(device));<br> vlc_object_delete(device);<br> }<br> }<br>diff --git a/src/misc/objects.c b/src/misc/objects.c<br>index f87edd9827f..370f7a92e98 100644<br>--- a/src/misc/objects.c<br>+++ b/src/misc/objects.c<br>@@ -135,6 +135,7 @@ void vlc_object_deinit(vlc_object_t *obj)<br> <br> void (vlc_object_delete)(vlc_object_t *obj)<br> {<br>+ vlc_objres_clear(obj);<br> vlc_object_deinit(obj);<br> free(obj);<br> }<br>diff --git a/src/modules/modules.c b/src/modules/modules.c<br>index 2df5702f840..93ca5c8fa75 100644<br>--- a/src/modules/modules.c<br>+++ b/src/modules/modules.c<br>@@ -272,8 +272,6 @@ void module_unneed(vlc_object_t *obj, module_t *module)<br> <br> if (module->deactivate != NULL)<br> module->deactivate(obj);<br>-<br>- vlc_objres_clear(obj);<br> }<br> <br> module_t *module_find (const char *name)<br>diff --git a/src/network/tls.c b/src/network/tls.c<br>index 2fde82d61a4..3cf7546691f 100644<br>--- a/src/network/tls.c<br>+++ b/src/network/tls.c<br>@@ -101,7 +101,6 @@ void vlc_tls_ServerDelete(vlc_tls_server_t *crd)<br> return;<br> <br> crd->ops->destroy(crd);<br>- vlc_objres_clear(VLC_OBJECT(crd));<br> vlc_object_delete(crd);<br> }<br> <br>@@ -129,7 +128,6 @@ void vlc_tls_ClientDelete(vlc_tls_client_t *crd)<br> return;<br> <br> crd->ops->destroy(crd);<br>- vlc_objres_clear(VLC_OBJECT(crd));<br> vlc_object_delete(crd);<br> }<br> <br>diff --git a/src/video_output/display.c b/src/video_output/display.c<br>index 76d49ee240d..db83ee74a43 100644<br>--- a/src/video_output/display.c<br>+++ b/src/video_output/display.c<br>@@ -785,7 +785,6 @@ vout_display_t *vout_display_New(vlc_object_t *parent,<br> if (VoutDisplayCreateRender(vd)) {<br> if (vd->close != NULL)<br> vd->close(vd);<br>- vlc_objres_clear(VLC_OBJECT(vd));<br> video_format_Clean(&vd->fmt);<br> goto error;<br> }<br>@@ -814,7 +813,6 @@ void vout_display_Delete(vout_display_t *vd)<br> <br> if (vd->close != NULL)<br> vd->close(vd);<br>- vlc_objres_clear(VLC_OBJECT(vd));<br> <br> video_format_Clean(&vd->source);<br> video_format_Clean(&vd->fmt);<br>diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c<br>index 9d207ac7095..9f615f9c0cd 100644<br>--- a/src/video_output/opengl.c<br>+++ b/src/video_output/opengl.c<br>@@ -105,7 +105,6 @@ void vlc_gl_Release(vlc_gl_t *gl)<br> <br> if (gl->destroy != NULL)<br> gl->destroy(gl);<br>- vlc_objres_clear(VLC_OBJECT(gl));<br> vlc_object_delete(gl);<br> }<br> <br>diff --git a/src/video_output/window.c b/src/video_output/window.c<br>index 16ebf9ef5a2..aeab072ce6c 100644<br>--- a/src/video_output/window.c<br>+++ b/src/video_output/window.c<br>@@ -140,7 +140,6 @@ void vout_window_Delete(vout_window_t *window)<br> if (window->ops->destroy != NULL)<br> window->ops->destroy(window);<br> <br>- vlc_objres_clear(VLC_OBJECT(window));<br> vlc_mutex_destroy(&w->lock);<br> vlc_object_delete(window);<br> }</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>