<html><head></head><body>I don't really see the point in unloading a system library, and the patch will lead to UB w/ multiple instances.<br><br><div class="gmail_quote">Le 19 juin 2017 14:46:39 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo@beauzee.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">CID #1446132<br />---<br /> src/libvlc.h | 1 +<br /> src/win32/specific.c | 1 +<br /> src/win32/thread.c | 10 +++++++++-<br /> 3 files changed, 11 insertions(+), 1 deletion(-)<br /><br />diff --git a/src/libvlc.h b/src/libvlc.h<br />index 15db8e037f..904be85a84 100644<br />--- a/src/libvlc.h<br />+++ b/src/libvlc.h<br />@@ -40,6 +40,7 @@ extern void vlc_DeinitActions (libvlc_int_t *, struct vlc_actions *);<br /> void system_Init ( void );<br /> void system_Configure ( libvlc_int_t *, int, const char *const [] );<br /> #if defined(_WIN32) || defined(__OS2__)<br />+void vlc_ReleaseTimerLibrary();<br /> void system_End(void);<br /> #ifndef __OS2__<br /> size_t EnumClockSource( vlc_object_t *, const char *, char ***, char *** );<br />diff --git a/src/win32/specific.c b/src/win32/specific.c<br />index c38890febc..56d9fa1c44 100644<br />--- a/src/win32/specific.c<br />+++ b/src/win32/specific.c<br />@@ -186,6 +186,7 @@ void system_Configure( libvlc_int_t *p_this, int i_argc, const char *const ppsz_<br /> */<br /> void system_End(void)<br /> {<br />+ vlc_ReleaseTimerLibrary();<br /> /* XXX: In theory, we should not call this if WSAStartup() failed. */<br /> WSACleanup();<br /> }<br />diff --git a/src/win32/thread.c b/src/win32/thread.c<br />index 40c294dd52..f5688e20af 100644<br />--- a/src/win32/thread.c<br />+++ b/src/win32/thread.c<br />@@ -829,6 +829,8 @@ void (msleep)(mtime_t delay)<br /> }<br /> #endif<br /> <br />+HMODULE hWinmm = INVALID_HANDLE_VALUE;<br />+<br /> static BOOL SelectClockSource(void *data)<br /> {<br /> vlc_object_t *obj = data;<br />@@ -878,7 +880,7 @@ static BOOL SelectClockSource(void *data)<br /> TIMECAPS caps;<br /> MMRESULT (WINAPI * timeBeginPeriod)(UINT);<br /> <br />- HMODULE hWinmm = LoadLibrary(TEXT("winmm.dll"));<br />+ hWinmm = LoadLibrary(TEXT("winmm.dll"));<br /> if (!hWinmm)<br /> goto perf;<br /> <br />@@ -924,6 +926,12 @@ static BOOL SelectClockSource(void *data)<br /> return TRUE;<br /> }<br /> <br />+void vlc_ReleaseTimerLibrary()<br />+{<br />+ if (hWinmm != INVALID_HANDLE_VALUE)<br />+ FreeLibrary(hWinmm);<br />+}<br />+<br /> size_t EnumClockSource (vlc_object_t *obj, const char *var,<br /> char ***vp, char ***np)<br /> {</pre></blockquote></div><br>
-- <br>
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>