Inconsistant compiler result


Licensed User
I am not sure if this is a bug or a problem with my set-up:-

Sometimes my program crashes on a "bitmap1.Dispose" command, but not every time. The error message is always the same - attached below.

This small section of code had been working fine for some time, but I assumed my program was faulty. However, I could not find the problem.

Then I discovered that the first compile after loading the IDE always produces an exe that works OK, but any re-compile after that, without re-starting the IDE, makes an exe that always has the error!

I'm using optimized compile, version 6.05, no recent changes to libraries and believe ImageLib and other libs are the correct files on desktop and device. The error only happens on the device - .Net 2, WM5 and emulator for WM6. Un-optimized exe's do not have the error.

Any ideas?

(By the way, despite this little problem I think the optimized compiler is fantastic.)



Licensed User
Yes, but I isolated the failure point by inserting MsgBox's. All the SQL routines before and after this were checked by commenting out the problem section (which just loads a jpg into an Image control) and all work fine.

The offending code section is below. It wouldn't be practical to upload the whole project, but I will PM you.


w = bitmap1.Width
h = bitmap1.Height
imgOP.Image = bitmap1.Value
imgOP.Image = imgOP.Image
bitmap1.Dispose * ERROR HERE *
imgOP.Width = imgOP.Height*(w/h)