its because you declare a pointer, but not any memory to store the data in!
so, when pollevent writes the data to where you told it to, that could be
anywhere in memory and it must take that 2-3 seconds before it over-writes
anything important.
try this (although you might as well just not use a pointer):
Hope this helps, if im not totaly missing something obvious here, you might
want to check out some tutorials on pointers and dynamic memory to help
understand whats going on (:> ----- Original Message -----
From: psymaster@caths.co.uk ()
To:
Sent: Friday, January 09, 2004 9:28 AM
Subject: [SDL] PollEvent() crashes app when it’s passed a pointer directly.
hey Sebastion, i put the delete in because if you notice, on key down the
program exits, we dont want memory leaks do we? (:> ----- Original Message -----
From: s.beschke@gmx.de (Sebastian Beschke)
To:
Sent: Friday, January 09, 2004 11:08 AM
Subject: Re: [SDL] PollEvent() crashes app when it’s passed a pointer
directly.
Alan Wolfe wrote:
try this (although you might as well just not use a pointer):
hey Sebastion, i put the delete in because if you notice, on key down the
program exits, we dont want memory leaks do we? (:
Unless you’re using Windows 95 or the like a process can’t leak memory
beyond exiting. I guess you know that and that’s why you put a smiley
at the end, though. ;-)–
Christian
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040109/ef9fdbf5/attachment.pgp