[Mono-osx] Memory Leak ?

Matthew Hazlett hazlema at gmail.com
Mon Jan 10 01:10:47 EST 2011


After comparing your version and mine, they are identical the only 
differences var names and some XML in the nib.  (I used the diff tool, 
even the line spacing was identical).

So, thinking I've going completely insigne I decide to rewrite it, and 
it works !!!?@#%@

I guess there must have been an error in the XML file somewhere? I'm not 
sure.

I'll attach the copy I had that was broken if you feel like poking around.

-Matthew

> ------------------------------------------------------------------------
>
> 	kjpou <mailto:kjpou at pt.lu>
> January 10, 2011 12:08 AM
>
>
> Mathew
>
> No problem.
>
> Make sure you have your field attached to the outlet in IB.  Even if 
> you do think it is go back in and attach it again.  Close down IB just 
> to make sure there are no changes still pending.
>
> Kenneth
>
>
>
> ------------------------------------------------------------------------
>
> 	hazlema <mailto:hazlema at gmail.com>
> January 10, 2011 12:00 AM
>
>
> Yours works like a charm and on first impressions looks identical to 
> mine.
> I know it can't be but... (My head explodes)
>
> Thanks I'lll need to find whats different, thank you for taking the 
> time to
> do this.
> I'll learn this one way or another .
> ------------------------------------------------------------------------
>
> 	kjpou <mailto:kjpou at pt.lu>
> January 9, 2011 11:52 PM
>
>
> Hello
>
> Try this one:
>
> It works on my machine.
>
> Hope it helps
>
> Kenneth
>
>
> ------------------------------------------------------------------------
>
> 	hazlema <mailto:hazlema at gmail.com>
> January 9, 2011 11:00 PM
>
>
> The timer delegate was in the AwakeFromNib() section.
>
> public override void AwakeFromNib ()
> {
> base.AwakeFromNib ();
>
> t = NSTimer.CreateRepeatingScheduledTimer(1,delegate {
> txtClock.StringValue = DateTime.Now.ToLongTimeString();
> });
> }
>
> But I still get that nasty error
>
> Unhandled Exception: System.NullReferenceException: Object reference 
> not set
> to an instance of an object
> at UglyClock.MainWindowController.<AwakeFromNib>m__0 () [0x00000] in
> <filename unknown>:0
> at MonoMac.Foundation.NSActionDispatcher.Apply () [0x00000] in <filename
> unknown>:0
> at (wrapper native-to-managed)
> object:[MonoMac.Foundation.NSActionDispatcher:Void Apply()]
> (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector)
> at (wrapper managed-to-native)
> MonoMac.AppKit.NSApplication:NSApplicationMain (int,string[])
> at MonoMac.AppKit.NSApplication.Main (System.String[] args) [0x00000] in
> <filename unknown>:0
> at UglyClock.MainClass.Main (System.String[] args) [0x00000] in <filename
> unknown>:0
>
> I don't know how to fix it, I have tried so many different ways of coding
> this today.
> Can you maybe give me a short code sample?
>
> ------------------------------------------------------------------------
>
> 	Matthew Hazlett <mailto:hazlema at gmail.com>
> January 9, 2011 1:52 PM
>
>
>
> I made a terribly simple application, on the MainWindow I put a label 
> then in the code I had it update the label every 1000 of a second.
>
>         ...
>        Timer t = new Timer(1000);
>         ...
>
>         public override void AwakeFromNib ()
>         {
>             base.AwakeFromNib ();
>
>             t.Elapsed += delegate {
>                 txtClock.StringValue = DateTime.Now.ToLongTimeString();
>             };
>
>             t.Start();
>         }
>
> But it keeps throwing warning errors at me for every tick, what am I 
> missing and how do I fix it?
> /2011-01-09 13:47:30.563 UglyClock[79395:7103] *** 
> __NSAutoreleaseNoPool(): Object 0x540f80 of class NSCFString 
> autoreleased with no pool in place - just leaking/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110110/1606f659/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 1421 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110110/1606f659/attachment-0002.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1525 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110110/1606f659/attachment-0003.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UglyClock.zip
Type: application/zip
Size: 23540 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110110/1606f659/attachment-0001.zip 


More information about the Mono-osx mailing list