Fixing crash.
This commit is contained in:
parent
07767de0b8
commit
f5b116d308
1 changed files with 7 additions and 19 deletions
|
|
@ -113,22 +113,6 @@ void rails_release(magic_api * api, int which,
|
|||
|
||||
void rails_shutdown(magic_api * api)
|
||||
{
|
||||
//#if 0
|
||||
// Activating to test after avoiding to write out of rails_status_of_segments
|
||||
// let's see if it works...
|
||||
|
||||
// FIXME -- commented out because a leak is better than a crash
|
||||
//
|
||||
// *** glibc detected *** /tmp/dd/usr/bin/tuxpaint: munmap_chunk(): invalid pointer
|
||||
// : 0x108bd098 ***
|
||||
// ======= Backtrace: =========
|
||||
// /lib/libc.so.6[0xf9373a8]
|
||||
// /usr/lib/tuxpaint/plugins/rails.so(rails_shutdown+0xac)[0xe7cf67c]
|
||||
// /tmp/dd/usr/bin/tuxpaint[0x1000882c]
|
||||
// /tmp/dd/usr/bin/tuxpaint[0x10021900]
|
||||
// /lib/libc.so.6[0xf8d6b10]
|
||||
// /lib/libc.so.6[0xf8d6cd0]
|
||||
|
||||
Uint8 i;
|
||||
|
||||
if (rails_snd!=NULL)
|
||||
|
|
@ -142,8 +126,8 @@ void rails_shutdown(magic_api * api)
|
|||
for (i = 0; i < 4; i++)
|
||||
free(rails_images[i]);
|
||||
free(rails_images);
|
||||
free(rails_status_of_segments);
|
||||
//#endif
|
||||
if (rails_status_of_segments != NULL)
|
||||
free(rails_status_of_segments);
|
||||
}
|
||||
|
||||
void rails_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
||||
|
|
@ -162,7 +146,11 @@ void rails_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
|
||||
void rails_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
||||
{
|
||||
free(rails_status_of_segments);
|
||||
if (rails_status_of_segments != NULL)
|
||||
{
|
||||
free(rails_status_of_segments);
|
||||
rails_status_of_segments = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Interactivity functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue