2009-01-27 Mike Kestner <mkestner@novell.com>

* glib/Opaque.cs:  ensure we are running on the gui thread when we
	dispose from the finalizer.  [Fixes #419777]

svn path=/trunk/gtk-sharp/; revision=124683
This commit is contained in:
Mike Kestner 2009-01-27 17:45:15 +00:00
parent 1d9f50edb7
commit d7f231117d
2 changed files with 29 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2009-01-27 Mike Kestner <mkestner@novell.com>
* glib/Opaque.cs: ensure we are running on the gui thread when we
dispose from the finalizer. [Fixes #419777]
2009-01-26 Mike Kestner <mkestner@novell.com>
* glib/Value.cs: make the pad fields a blink explicitly sized struct

View file

@ -88,9 +88,32 @@ namespace GLib {
}
}
class FinalizeInfo {
Type type;
IntPtr native;
bool owned;
public FinalizeInfo (Type type, IntPtr native, bool owned)
{
this.type = type;
this.native = native;
this.owned = owned;
}
public bool Handler ()
{
Opaque inst = GetOpaque (native, type, owned);
inst.Dispose ();
return false;
}
}
~Opaque ()
{
Dispose ();
if (_obj == IntPtr.Zero)
return;
FinalizeInfo info = new FinalizeInfo (GetType(), _obj, owned);
Timeout.Add (50, new TimeoutHandler (info.Handler));
}
public virtual void Dispose ()