Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro on NuGet!

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Allegro on NuGet!
Brooklyn
Member #12,433
December 2010
avatar

I've figured out the issue. I was not manually resetting (a call to the smart pointer's reset function) a file-scope smart pointer during the user-defined cleanup phase. If that step is missed, the C++ Standard says destruction of the smart pointers takes place during std::exit. Since Allegro has hooked into exit via a call to std::atexit it effectively shuts down before exit is called. Then any smart pointers try to use the custom deleters pointing to Allegro functions...which no longer work. Crash with accessing a no-man's-land (0xDDDDDDD) or null pointer address.

I love programming. I hate debugging. :P

Edgar Reynaldo
Member #8,592
May 2007
avatar

Bambam would say that's what you get for using globals. :-/

And as an aside, if you're manually calling reset, why are you using a smart pointer in the first place?

Brooklyn
Member #12,433
December 2010
avatar

Because they are a great feature to have...as long as a third party library does not hook into the exit function and shutdown the use of the custom deleters. :P

With this issue resolved I now declare the NuGet package awesome and easy to use and set up. PDBs would still be a nice feature though.

(P.S. I can't seem to find the Quote button on this forum software)

Edgar Reynaldo
Member #8,592
May 2007
avatar

You're welcome to shutdown allegro manually, by avoiding the allegro atexit shutdown by using al_install_system and then calling al_uninstall_system after your globals get destroyed.

Bruce Pascoe
Member #15,931
April 2015
avatar

There is no quote button, as I found out a while back. :-/ You have to greentext:

> Some text to quote

As for this:

Brooklyn said:

I love programming. I hate debugging.

I must be weird. I'll get a bug report or come across a bug myself, I rub my hands together in an excited "let's get to work!" way, and fire up the debugger. I probably have more fun debugging than I do writing the original (buggy ;)) code.

That said, the type of bug you had to deal with isn't very fun, even for me.

 1   2 


Go to: