[Mono-osx] Memory Leak ?

hazlema hazlema at gmail.com
Sun Jan 9 23:00:09 EST 2011


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?

-- 
View this message in context: http://mono.1490590.n4.nabble.com/Memory-Leak-tp3206211p3206589.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list