On Fri, Aug 01, 2008 at 05:42:19PM +0200, Vadim Lebedev wrote:
> >I've identified two other crashes related to going offline:
> >- Crash with open chat window when going offline/online:
> > - Open a chat
> > - go offline
> > - go online
> > - re-open chat to same or other contact
> > - crash
> > -> Whats the proper way to close open chat (or other?!) windows here?
> >
> I think the simplest and possibily even correct way would be to
> close all open chat windows.
OK, I've tried several options. Attached is a diff of the changes I've
made (please *don't* apply these, there here to illustrate what I've
tried): I've added a new method to close all the tabs and call this when
the UserProfile is destroyed.
- Works fine as long as there aren't any entries in the chat windows.
- I get a crash in src/control/history/CHistory.cpp in
CHistory::historyMementoAddedEventHandlerThreadSafe note the changes
in that file
- I thought first that the event handlers should be removed from the
History object on destructor time -- didn't work out, obviously the
CHistory::historyMementoAddedEventHandler is called while the
CHistory object still lives. The
CHistory::historyMementoAddedEventHandlerThreadSafe handler is
called *after* the object is destructed (with a crash as the result
because the _pHistory pointer is garbage).
- even if I comment out the code in
CHistory::historyMementoAddedEventHandlerThreadSafe
the code crashes somewhere else, in ContactList::lock (the "this"
pointer is 0x0 in that call) called by the
ContactListXMLSerializer::serialize when trying to save the user
profile (maybe that tries to save the chat history?).
So either QtWengoPhone::currentUserProfileWillDieEventHandlerSlot is not
the right spot to call closeAllTabs for the ChatWindow or this isn't the
right approach altogether.
Is currentUserProfileWillDieEventHandlerSlot called *before* the user
profile is actually destroyed or afterwards?
I've also tried more obvious things in
QtWengoPhone::currentUserProfileWillDieEventHandlerSlot:
- _chatWindow->close ();
- same as above and set _chatWindow to NULL
- OWSAFE_DELETE(_chatWindow);
closing the window makes the client unstable, using OWSAFE_DELETE gets
us a segfault when going offline the second time (double free in libc)
Any ideas what to try next?
Ralf
--
Dr. Ralf Schlatterbeck Tel: +43/2243/26465-16
Open Source Consulting Fax: +43/2243/26465-23
Reichergasse 131 www: http://www.runtux.com
A-3411 Weidling email: [EMAIL PROTECTED]
osAlliance member email: [EMAIL PROTECTED]
_______________________________________________
QuteCom-dev mailing list
[email protected]
http://lists.qutecom.org/mailman/listinfo/qutecom-dev