From: Max G. <max...@ho...> - 2000-12-29 19:12:44
|
>while working on an Allegro-wrapper I stumbled over the following >peculiarity ... When I want to define a variable globally my program >crashes. Maybe I can help you. I have tried the same with DJGPP 2.952b and Allegro 3.9.33 and have experienced basically the same error Propably your problem is that ALLEGRO_BITMAP's destructor is called when your program is being closed. But though it uses Allegro's destroy_bitmap(). I guess you don't have any more working acces to this function as allegro_exit() is called on exit. Propably allegro_exit() is called before ~ALLEGRO_BITMAP(). If you change this providing no destructor but e.g. a member-function ALLEGRO_BITMAP::destroy() that does the same like your destructor everything works fine if you call xbmp2.destroy() somewhere in main(). In deed I would not use a destructor in this case. HTH __ /..\__ / \ _ \ `____/ _ __/ \___|__|____/ \____Max Ger...@ho... \_/ \_/ PS: I don't think "Why is this code not working...?" is a very informative subject... _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |