|
Program terminates on error |
adhrymes
Member #6,567
November 2005
|
Hey guys, EDIT: A side note: it's been too long since my algorithms class and I forget how STL allocates memory. im always someone who likes doing everything himself but im foring myself to use STL here cause i know once i get used to it i'll like it. anyway so now when packing my vectors im doing END EDIT thanks
-----------------
|
CGamesPlay
Member #2,559
July 2002
|
Please click this link and use [code] tags. -- Ryan Patterson - <http://cgamesplay.com/> |
miran
Member #2,407
June 2002
|
I was told Allegro is not thread safe. Which means you can't do what you're trying to do. Which brings me to my first question. What are you trying to do and why do you have to use threads? -- |
adhrymes
Member #6,567
November 2005
|
thanks for the link to the text formatting thing. |
miran
Member #2,407
June 2002
|
I don't know how well Allegro works or doesn't work with threads. I just know that officially it's not thread safe, but that doesn't mean you can't get it to work. I don't know how though... -- |
CGamesPlay
Member #2,559
July 2002
|
I believe we can quote Kitty Cat saying something along the lines of: Quote: Allegro should wokr fine if you e.g. keep the sound in one thread and don't touch the sound anywhere else.
-- Ryan Patterson - <http://cgamesplay.com/> |
Billybob
Member #3,136
January 2003
|
You're destroying a bitmap in the destructor of that class. I'm not sure if Allegro will be shutdown by the time that occurs. If I'm right, Allegro will have shutdown before the destructor is called, hence you're calling an allegro function after Allegro has left the building. If that is the case simply do: EDIT: Actually I just noticed you do allegro_exit at the end, so yeah Allegro is shutdown before the destructor is called. I suggest doing what I said above and make sure you call delete before allegro_exit scheduler game; game.init(); /* bunch of stuff*/ game.cleanup(); allegro_exit();
|
A J
Member #3,025
December 2002
|
i use multiple threads with allegro. the other thing i use is a global uint32_t as a set of flags.. and set 'milestones' for startup/shutdown.. glb_milestone |= ALLEGRO_START; allegro_init(); then another thread can do things like: if ( ALLEGRO_START & glb_milestone ) can_do_allegro_stuff(); that why i can detect when each thread can/can-not processed.. its a primitve form of locking, but it works well, easy to implement. ___________________________ |
adhrymes
Member #6,567
November 2005
|
nice I manually destructed everything and it works great now, thanks alot. also i like that milestone idea and am going to implement it, thanks alot guys |
|