Windows Mobile: ObjectDisposedException

Jul 30, 2010 at 9:19 AM
Edited Jul 30, 2010 at 9:21 AM

I'm using the Gmaps.Net in a Windows Mobile application. I regulary receive the following error when I exit the application. I have also had this exception in the demo application, also when terminating the application:

ObjectDisposedException 
at 
System.Threading.Waithandle.CheckResultInternal(Boolean r) 
at 
System.Threading.EventWaitHandle.WaitOne() 
at 
Gmap.NET.Internals.Core.ProcessLoadTask() 
at 
OpenNetCF.Threading.Thread2.ShimProc() 

Anyone an idea how I can prevent this error from happening?

Jul 30, 2010 at 11:28 AM

is it only mobile issue?

Jul 30, 2010 at 11:30 AM

I've only used and tested it in mobile, can't say anything about other platforms...

Jul 30, 2010 at 11:41 AM

i see, well on exit event, i dispose that handle while loading threads still are waiting:

      public void OnMapClose()
      {
         CancelAsyncTasks();

         if(waitForTileLoad != null)
         {
            try
            {
               waitForTileLoad.Set();
               waitForTileLoad.Close();
            }
            catch
            {
            }
         }
      }

..for fast solution, you can comment out try block

Jul 30, 2010 at 12:30 PM
Edited Aug 2, 2010 at 1:16 PM

Thanks radioman, I'll try that!

/edit: Commenting out that block did solve the problem, thanks!

Aug 10, 2010 at 8:27 PM

fixed

Aug 10, 2010 at 9:17 PM

Great, thanks!