Runs on PC but not on Mac

BlitzMax Forums/MaxGUI Module/Runs on PC but not on Mac

TAS(Posted 2013) [#1]
I have a game. It runs in a Max GUI window and consists of two side by side canvases. It runs fine under Windows 7 but when I compile it on a Mac Mini it draws correctly one time than the whole window area shows one canvas or the back buffer before it crashes. Disabling Event hooks or canvas drawing doesn't change the result. Print statements seem to indicate the crash occurs in the waitevent() loop rather than during screen drawing. Debug mode does not yield any useful information and seems to shorten the time for the crash to occur. The Mac error report usually indicates some sort of memory violation. Any ideas what cause could be?


Midimaster(Posted 2013) [#2]
Do you use the function ActivGadget()? Or a toolbar Gadget?


TAS(Posted 2013) [#3]
No toolbar gadgets but lots of activategadget calls to return the focus to the main canvas


skidracer(Posted 2013) [#4]
Make sure to call SetViewport at the beginning of your EVENT_GADGETPAINT handler.


TAS(Posted 2013) [#5]
Added set viewport set to canvas size and commented out all activate gadget commands. It updates the canvas once, enters the main loop, executes one EVENT_GADGETPAINT and than crashes before as soon as an enters a waitevent(). Hooks have been disabled. Here's the error report

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x94dd1a8b objc_msgSend + 27
1 com.apple.AppKit 0x9164cc08 -[NSWindow dealloc] + 1259
2 00 Main.debug 0x000b14e1 -[WindowView dealloc] + 465
3 com.apple.AppKit 0x915125b3 -[NSWindow release] + 170
4 libobjc.A.dylib 0x94dd4442 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 490
5 com.apple.CoreFoundation 0x90168a73 _CFAutoreleasePoolPop + 51
6 com.apple.Foundation 0x93e86116 -[NSAutoreleasePool release] + 125
7 00 Main.debug 0x00002f1d bbFlushAutoreleasePool + 45
8 00 Main.debug 0x002672df updateEvents + 431
9 00 Main.debug 0x00267507 bbSystemWait + 39
.... lots more


Midimaster(Posted 2013) [#6]
Maybe you found the same ActivGadget() problem like me?

http://www.blitzbasic.com/Community/posts.php?topic=100857#bottom


skidracer(Posted 2013) [#7]
Are you in Debug mode?

If it is easy to reproduce and you are happy to send me your project, pls email me at my blitzbasic.com email address.