Skip to content

Commit

Permalink
libcore|Garbage: Avoid crash at shutdown
Browse files Browse the repository at this point in the history
Accessing de::Log in anything that gets called after main() has been
exited is not a good idea. Recycling occurs when the global Garbages
is destroyed.
  • Loading branch information
skyjake committed Jan 20, 2016
1 parent 4e8f185 commit 16d3634
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doomsday/sdk/libcore/src/core/garbage.cpp
Expand Up @@ -13,7 +13,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#include "de/Garbage"
Expand Down Expand Up @@ -52,7 +52,9 @@ struct Garbage : public Lockable

if(allocs.empty()) return;

LOG_TRACE("Recycling %i allocations/instances") << allocs.size();
#ifdef DENG2_DEBUG
qDebug() << "[Garbage] Recycling" << allocs.size() << "allocs/objects";
#endif

for(Allocs::iterator i = allocs.begin(); i != allocs.end(); )
{
Expand Down

0 comments on commit 16d3634

Please sign in to comment.