mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-25 22:41:07 +00:00
2005-10-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* glib/MainContext.cs: added a Depth property to p/invoke g_main_depth. * glib/Object.cs: (Dispose): immediately call g_object_unref without queueing when possible (MainContext.Depth > 0) and use Timeout.Add instead of Idle.Add to get our unref callback scheduled more reliably. svn path=/trunk/gtk-sharp/; revision=51448
This commit is contained in:
parent
8456979ca5
commit
8900d1ccd7
|
@ -1,3 +1,11 @@
|
||||||
|
2005-10-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
|
||||||
|
|
||||||
|
* glib/MainContext.cs: added a Depth property to p/invoke g_main_depth.
|
||||||
|
* glib/Object.cs:
|
||||||
|
(Dispose): immediately call g_object_unref without queueing when
|
||||||
|
possible (MainContext.Depth > 0) and use Timeout.Add instead of Idle.Add
|
||||||
|
to get our unref callback scheduled more reliably.
|
||||||
|
|
||||||
2005-10-05 Mike Kestner <mkestner@novell.com>
|
2005-10-05 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* bootstrap : bump version for beta3.
|
* bootstrap : bump version for beta3.
|
||||||
|
|
|
@ -26,6 +26,12 @@ namespace GLib {
|
||||||
|
|
||||||
public class MainContext {
|
public class MainContext {
|
||||||
|
|
||||||
|
[DllImport("libglib-2.0-0.dll")]
|
||||||
|
static extern int g_main_depth ();
|
||||||
|
public static int Depth {
|
||||||
|
get { return g_main_depth (); }
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport("libglib-2.0-0.dll")]
|
[DllImport("libglib-2.0-0.dll")]
|
||||||
static extern bool g_main_context_iteration (IntPtr Raw, bool MayBlock);
|
static extern bool g_main_context_iteration (IntPtr Raw, bool MayBlock);
|
||||||
|
|
||||||
|
|
|
@ -80,11 +80,18 @@ namespace GLib {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disposed = true;
|
disposed = true;
|
||||||
|
if (MainContext.Depth > 0) {
|
||||||
|
g_object_unref (_obj);
|
||||||
|
Objects.Remove (_obj);
|
||||||
|
GC.SuppressFinalize (this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lock (PendingDestroys){
|
lock (PendingDestroys){
|
||||||
PendingDestroys.Add (this);
|
PendingDestroys.Add (this);
|
||||||
lock (typeof (Object)){
|
lock (typeof (Object)){
|
||||||
if (!idle_queued){
|
if (!idle_queued){
|
||||||
Idle.Add (new IdleHandler (PerformQueuedUnrefs));
|
Timeout.Add (50, new TimeoutHandler (PerformQueuedUnrefs));
|
||||||
idle_queued = true;
|
idle_queued = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue