Game Development Community

ConsoleLogger listener bugfix

by Daan Broekhof · 08/03/2005 (4:01 pm) · 1 comments

Download Code File

In my effort to submit some of my small fixes for the greater good, here is a fix for a bug in the consoleLogger class.

The bug: (CVS TGE Version 1.4 Head, 02-Aug-2005):
A console listening callback is created each time a consoleLogger is created, when only one is needed for all loggers.
When multiple callback functions are active you get the effect that each line in the console will be written multiple times into your logfiles.
(this bug effectively made the whole thing broken if you used it more than once)
I also posted it a while back in the bugforum: The thread

The fix:
- Made the mInitalized a static class variable
- Added checking to the consoleLogging initialisation
- Added checking the consoleLogger detach function to remove the callback when there are no loggers active anymore

A patch for the bug is attached to this resouce. (affected files: consoleLogger.h, consoleLogger.cc)

#1
08/03/2005 (4:01 pm)
On my list for 1.4 RC2, #246.