[ wxwindows-Patches-1857589 ] assertion during ~wxLog when using log repetition count

SourceForge.net noreply at sourceforge.net
Wed Jan 2 13:29:07 PST 2008


Patches item #1857589, was opened at 2007-12-24 16:32
Message generated for change (Comment added) made by vadz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1857589&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 8
Private: No
Submitted By: Rodolfo Schulz de Lima (rodlima)
Assigned to: Nobody/Anonymous (nobody)
Summary: assertion during ~wxLog when using log repetition count

Initial Comment:
In wxLog::~wxLog, there's a call to LogLastRepetitionCountIfNeeded that tries write a log item, but as we're already in a destructor, the virtual member call doesn't happen the way it was intended, and despite of the actual object being (or were) a derived class, wxLog::DoLogString gets called, giving us an assertion message.

I don't think that LogLastRepetionCountIfNeeded should be called in destrutor. For this to work, it should have been called in every child class that implements wxLog::DoLogString, which IMHO is burdensome. A better solution is needed. Meanwhile, I think is reasonable not to call it, since there's no other way to avoid the assertion.

----------------------------------------------------------------------

>Comment By: Vadim Zeitlin (vadz)
Date: 2008-01-02 22:29

Message:
Logged In: YES 
user_id=71618
Originator: NO

I agree that the current code can't work, pity we didn't notice it when
the log repetition was implemented :-( We probably should call
LogLastRepetionCountIfNeeded() from Flush() however. And I also added debug
logging to ~wxLog in the trunk to detect when log objects are deleted
unflashed.

As before, please let me know if you still have any problems as I don't
really have any test code for this.

Thanks!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1857589&group_id=9863




More information about the wx-dev mailing list