зеркало из https://github.com/mono/mail-archives.git
184 строки
6.8 KiB
HTML
184 строки
6.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-osx] Exception disposing of object
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=Re%3A%20%5BMono-osx%5D%20Exception%20disposing%20of%20object&In-Reply-To=%3CCAMga9iTY8MMcrj%2BoyZrUqy0CyztBf7-EOXOkRspy_ZruUTa2%2BQ%40mail.gmail.com%3E">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<style type="text/css">
|
|
pre {
|
|
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
|
|
}
|
|
</style>
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="005017.html">
|
|
<LINK REL="Next" HREF="005021.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-osx] Exception disposing of object</H1>
|
|
<B>Michael Hutchinson</B>
|
|
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=Re%3A%20%5BMono-osx%5D%20Exception%20disposing%20of%20object&In-Reply-To=%3CCAMga9iTY8MMcrj%2BoyZrUqy0CyztBf7-EOXOkRspy_ZruUTa2%2BQ%40mail.gmail.com%3E"
|
|
TITLE="[Mono-osx] Exception disposing of object">m.j.hutchinson at gmail.com
|
|
</A><BR>
|
|
<I>Wed Jun 13 18:38:21 UTC 2012</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="005017.html">[Mono-osx] Exception disposing of object
|
|
</A></li>
|
|
<LI>Next message: <A HREF="005021.html">[Mono-osx] [Solved] Monomac & Monodevel 3.0.2 problems (John Fourkiotis)
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#5018">[ date ]</a>
|
|
<a href="thread.html#5018">[ thread ]</a>
|
|
<a href="subject.html#5018">[ subject ]</a>
|
|
<a href="author.html#5018">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Could you please file a bug with the test project attached?
|
|
|
|
On 13 June 2012 14:31, Jon Lipsky <<A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">jon.lipsky at elevenworks.com</A>> wrote:
|
|
><i> Hi All,
|
|
</I>><i>
|
|
</I>><i> I'm getting random crashes in my MonoMac application in the
|
|
</I>><i> "NSObject.MonoMac_Disposer.Drain" method:
|
|
</I>><i>
|
|
</I>><i>  at (wrapper managed-to-native)
|
|
</I>><i> MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper (intptr,intptr) <IL
|
|
</I>><i> 0x00024, 0xffffffff>
|
|
</I>><i>   at MonoMac.Foundation.NSObject/MonoMac_Disposer.Drain
|
|
</I>><i> (MonoMac.Foundation.NSObject) [0x0003b] in
|
|
</I>><i> /Development/github/monomac/src/Foundation/NSObject.cs
|
|
</I>><i>   at (wrapper dynamic-method)
|
|
</I>><i> object.[MonoMac.Foundation.NSObject+MonoMac_Disposer.Void
|
|
</I>><i> Drain(MonoMac.Foundation.NSObject)]
|
|
</I>><i> (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject)
|
|
</I>><i> <IL 0x00011, 0x0004b>
|
|
</I>><i>   at (wrapper native-to-managed)
|
|
</I>><i> object.[MonoMac.Foundation.NSObject+MonoMac_Disposer.Void
|
|
</I>><i> Drain(MonoMac.Foundation.NSObject)]
|
|
</I>><i> (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject)
|
|
</I>><i> <IL 0x000b6, 0xffffffff>
|
|
</I>><i>   at (wrapper managed-to-native)
|
|
</I>><i> MonoMac.AppKit.NSApplication.NSApplicationMain (int,string[]) <IL 0x0009d,
|
|
</I>><i> 0xffffffff>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> By building my own version of MonoMac, I've been able to figure out that
|
|
</I>><i> this crash always occurs when it's trying to dispose of the "super_handle"
|
|
</I>><i> of my NSWindow subclass.
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> Has anyone seen this?  Am I doing something wrong, or could there possibly
|
|
</I>><i> be an issue with MonoMac here?
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> It's quite easy to reproduce this issue:
|
|
</I>><i>
|
|
</I>><i> 1) Create a new MonoMac document based project.
|
|
</I>><i>
|
|
</I>><i> 2) Create a subclass of NSWindow:
|
|
</I>><i>
|
|
</I>><i> using System;
|
|
</I>><i> using System.Collections.Generic;
|
|
</I>><i> using System.Drawing;
|
|
</I>><i> using MonoMac.AppKit;
|
|
</I>><i>
|
|
</I>><i> namespace DisposalProblem
|
|
</I>><i> {
|
|
</I>><i> public class TestWindow : NSWindow
|
|
</I>><i> {
|
|
</I>><i> public TestWindow () : base(new
|
|
</I>><i> RectangleF(100,100,500,500),NSWindowStyle.Resizable |
|
|
</I>><i> NSWindowStyle.Closable, NSBackingStore.Buffered, false)
|
|
</I>><i> {
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> public TestWindow (IntPtr aIntPtr) : base(aIntPtr)
|
|
</I>><i> {
|
|
</I>><i> }
|
|
</I>><i> }
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> 3) Use interface builder to have one of the pull down menus send the message
|
|
</I>><i> "showTestWindow:".
|
|
</I>><i>
|
|
</I>><i> 4) Add the following to your AppDelegate class:
|
|
</I>><i>
|
|
</I>><i> private TestWindow testWindow;
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> [Export("showTestWindow:")]
|
|
</I>><i> public void ShowTestWindow()
|
|
</I>><i> {
|
|
</I>><i> if (testWindow == null)
|
|
</I>><i> {
|
|
</I>><i> testWindow = new TestWindow();
|
|
</I>><i> testWindow.WillClose += HandleWillClose;
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> testWindow.MakeKeyAndOrderFront(this);
|
|
</I>><i> testWindow.Center();
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i> void HandleWillClose (object sender, EventArgs e)
|
|
</I>><i> {
|
|
</I>><i> testWindow.WillClose -= HandleWillClose;
|
|
</I>><i> testWindow = null;
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i> 5) Run the application, and open and close the window using the "wired up"
|
|
</I>><i> menu item.  Should take less than 20 seconds to make it crash.
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> Any help anyone could provide would be appreciated.
|
|
</I>><i>
|
|
</I>><i> Thanks,
|
|
</I>><i> Jon...
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> _______________________________________________
|
|
</I>><i> Mono-osx mailing list
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">Mono-osx at lists.ximian.com</A>
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</A>
|
|
</I>><i>
|
|
</I>
|
|
|
|
|
|
--
|
|
Michael Hutchinson
|
|
<A HREF="http://mjhutchinson.com">http://mjhutchinson.com</A>
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="005017.html">[Mono-osx] Exception disposing of object
|
|
</A></li>
|
|
<LI>Next message: <A HREF="005021.html">[Mono-osx] [Solved] Monomac & Monodevel 3.0.2 problems (John Fourkiotis)
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#5018">[ date ]</a>
|
|
<a href="thread.html#5018">[ thread ]</a>
|
|
<a href="subject.html#5018">[ subject ]</a>
|
|
<a href="author.html#5018">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
|
|
mailing list</a><br>
|
|
</body></html>
|