*** Unhandled exception *** when quit window?

Previous topic - Next topic

pinete

Hi,
I'm obtaining this error in the log just when quit clicking on "x" top right on the game window

*** Unhandled exception ***
   EXCEPTION_ACCESS_VIOLATION

the game seems to work perfectly but I get this error, and sometime, also when quit, apperars the typical error window saying that mygame.exe doesn't work, what do you want to do, quit or wait to this applications works again...

Any hint about the reason this is related to or the reason because this uses to happen?

Thanks in advance!

MrTAToad

It would sound like you aren't using SHOWSCREEN in the game loop, or as often as you should.

For example, this code could cause it :

Code (glbasic) Select
WHILE TRUE
WEND


Do you have any example code ?

pinete

Thanks so much MrTAToad,
Code is very long as I've not any suspect of a specific part of code :P so I guess it could be a madness copy here in the forum :P
re the example you gave me, I'm pretty sure I'm doing well, I've just one' Showscreen' in the mail program loop, that's all.
Do you have any other idea why this can happen?
Do you want me to send you the code to a private email address?
Thanks!

Quentin

sounds like a "out of bounds" exception, e.g. accessing a non existing array index. You should try to run your program in debug mode. Often you'll get some more details about the specific error.

pinete

Hi Quentin:)
I'm running in debug but it just says that when quits.. the game is normally executed showing no errors during game.. :P
is possible that's produced by an array and GLBasic just notify it when you quit?

Quentin

was just an idea. If the debugger is switched on, you'll possibly see some messages in the output window of the GLBasic IDE

here's a stupid sample:



[attachment deleted by admin]

Slydog

A tedious idea to narrow down the problem could be adding DEBUG statements to the start and end of each function.
That way you you'll know what function was executing just before the crash.
Then you could narrow that function down further with more DEBUG statements.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

#7
Possibly also divide by 0 would do it...

Are you using GLB_ON_QUIT ?

Kitty Hello

unhandled exception is bad. Can you send me the project you're using? Sorry :(

pinete

Hi Gernot, of course I can, how can I do that? what email account in order to give you my FTP?
thanks a lot for your help, I appreciate so much.

MrTAToad, nop, I'm not using GLB_ON_QUIT.. :/ Should I do it?

ampos

I got this msg because I was accesing an array with a big negative number.

Code (glbasic) Select
Z=Z-1000
a=arr[z]


Z was supposed to be 1001 or so, but I type -10000 instead of -1000.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

pinete

#11
really strange fact is that the game works properly and I just get the error when I click on the windows' close button to close the app, then the error message appears in the debug window...  :blink: So I wonder.. thinking about the possibility of the cause is an array out of range... It should not be the program who communicates this problem during runtime?
I've got before array errors and the program stops and GLBasic debug windows shows you the specific error.. :P

MrTAToad

#12
Thats why I thought you were using ON_QUIT...

I think you need to make the complete project available though.