[Mono-osx] Memory Leak ?

kjpou kjpou at pt.lu
Sun Jan 9 23:52:14 EST 2011


Hello

Try this one:

It works on my machine.

Hope it helps

Kenneth

On 1/10/11 5:00 AM, hazlema wrote:
> 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?
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TimerTest.zip
Type: application/zip
Size: 23077 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110110/f9fe889c/attachment-0001.zip 


More information about the Mono-osx mailing list