mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-03-01 17:47:59 +00:00
cairo: Make debug more robust
This commit is contained in:
parent
6e7527cb92
commit
50ee23f0f2
|
@ -50,7 +50,7 @@ namespace Cairo {
|
||||||
if (!Enabled)
|
if (!Enabled)
|
||||||
throw new InvalidOperationException ();
|
throw new InvalidOperationException ();
|
||||||
|
|
||||||
traces.Add (obj, Environment.StackTrace);
|
traces[obj] = Environment.StackTrace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnDisposed<T> (IntPtr obj, bool disposing)
|
public static void OnDisposed<T> (IntPtr obj, bool disposing)
|
||||||
|
@ -61,8 +61,11 @@ namespace Cairo {
|
||||||
if (!disposing) {
|
if (!disposing) {
|
||||||
Console.Error.WriteLine ("{0} is leaking, programmer is missing a call to Dispose", typeof(T).FullName);
|
Console.Error.WriteLine ("{0} is leaking, programmer is missing a call to Dispose", typeof(T).FullName);
|
||||||
if (Enabled) {
|
if (Enabled) {
|
||||||
Console.Error.WriteLine ("Allocated from:");
|
string val;
|
||||||
Console.Error.WriteLine (traces[obj]);
|
if (traces.TryGetValue (obj, out val)) {
|
||||||
|
Console.Error.WriteLine ("Allocated from:");
|
||||||
|
Console.Error.WriteLine (val);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Console.Error.WriteLine ("Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces");
|
Console.Error.WriteLine ("Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue