mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-02 05:43:07 +02:00
Fixed g_mutex_clear() to fully undo g_mutex_init()
In order to fully undo the effects of g_mutex_init(), it is necessary to reset the internal mutex pointer back to NULL so that a later call to g_mutex_init() actually works as expected.
This commit is contained in:
parent
b05bf77223
commit
56348210f3
@ -184,12 +184,13 @@ g_mutex_init (GMutex *mutex)
|
|||||||
* Calling g_mutex_clear() on a locked mutex leads to undefined
|
* Calling g_mutex_clear() on a locked mutex leads to undefined
|
||||||
* behaviour.
|
* behaviour.
|
||||||
*
|
*
|
||||||
* Sine: 2.32
|
* Since: 2.32
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
g_mutex_clear (GMutex *mutex)
|
g_mutex_clear (GMutex *mutex)
|
||||||
{
|
{
|
||||||
g_mutex_impl_free (mutex->p);
|
g_mutex_impl_free (mutex->p);
|
||||||
|
mutex->p = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user