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

Kenneth (Killers Software) kenneth at killerssoftware.com
Thu Aug 5 11:31:30 EDT 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1966 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20100805/f7df973c/attachment.bin 


More information about the Mono-osx mailing list