g_private_replace ordering issue
g_private_replace calls the notify function before replacing the value. This risks recursing if the notify checks the private value, directly or indirectly.
This can be seen in action here: gtk#2562 (closed)
In that example, calling g_private_replace ends up dropping the last reference of a GdkGLContext object, and the gdk_gl_context_dispose again unsets the private, leading to recursion.