[Mono-osx] __NSAutoreleasePool(): Object 0x14360f0 of class NSConcreteData autoreleased with no pool in place - just leaking

Geoff Norton gnorton at novell.com
Thu Aug 5 11:47:16 EDT 2010


monomac is not compatible with winforms.

-g

On 2010-08-05, at 11:31 AM, Kenneth (Killers Software) wrote:

> 
> I get this message when I try a simple NSData data = NSData.FromFile(aPath); if I don't have the NSAutoReleasePool created.
> 
> If I wrap the main routine code with NSAutoReleasePool just like how Objective-C iPhone app's main.m does it doesn't give me the error but it just sits there.
> 
> Any ideas?
> 
> using System;
> using System.Windows.Forms;
> using MonoMac.Foundation;
> 
> namespace HelloWorld
> {
> 	public class HelloWorld
> 	{
> 		public static void Main (string[] args)
> 		{
> 			NSAutoreleasePool pool = new NSAutoreleasePool();
> 			Application.EnableVisualStyles();
>            Application.SetCompatibleTextRenderingDefault(false);
> 			Application.Run(new HelloWorldForm());
> 			pool.Dispose();
> 			pool = null;
> 		}
> 	}
> }
> 
> else where
> 
> private void btnTest_Click(object sender, System.EventArgs e)
> {
> 	string fileName = txtFileName.Text;
>       	if (!File.Exists(fileName)) {
> 		MessageBox.Show(string.Format("file: {0} does not exist.", fileName));
> 	} else {
> 		NSData fileData = NSData.FromFile(fileName);
> 		MessageBox.Show(string.Format("file(length:{0}): {1}", fileData.Length, txtFileName.Text)); 
> 	}
> }
> 
> Thanks,
> 
> Kenneth_______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx



More information about the Mono-osx mailing list