> On Jan. 29, 2011, 4:51 p.m., Raphael Kubo da Costa wrote:
> > Did you happen to run Valgrind to check if these objects were leaking (the 
> > suppressions file in kdesdk/scripts help hide some useless warnings)? I can 
> > see that the Task class has some auto-deletion code (it doesn't seem to be 
> > used in client.cpp, though)?

I ran it now.
after quiting kopete, I can't see the objects leaking into valgrind's output.
But, I just figured out why that doesn't happen. Here's the flow:

1) Client object created
2) at login all kind of xxTask objects created. Their parent is d->root, a 
QObject 
3) at each login, the various d->xxxTask are overridden. With *new* objects
4) when quitting, Client object is destroyed -> d->root is destroyed, and since 
it is a QObject, it will destroy all its children xxxTask objects creating 
during step 2) and 3).

So, during its lifetime - kopete will eat more and more memory due to the bug I 
fixed.

Here's some portion from the log file - see how 3 (!) WebcamTask objects where 
deleted ! (I logged in/out 3 times).

kopete(16059)/kopete (yahoo - raw protocol) Client::close:
kopete(16059)/kopete (yahoo - raw protocol) WebcamTask::~WebcamTask: pointer is 
 0x1ede05f0
kopete(16059)/kopete (yahoo - raw protocol) WebcamTask::~WebcamTask: pointer is 
 0x185f33e0
kopete(16059)/kopete (yahoo - raw protocol) WebcamTask::~WebcamTask: pointer is 
 0x1a1cc390
kopete(16059)/libkopete Kopete::ChatSessionManager::removeSession:
kopete(16059)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x1a02b880 deleted 
without having been removed from the factory first. This will leak standalone 
popupmenus and could lead to crashes. 
kopete(16059)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x1862d8c0 deleted 
without having been removed from the factory first. This will leak standalone 
popupmenus and could lead to crashes. 
kopete(16059)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x1e189920 deleted 
without having been removed from the factory first. This will leak standalone 
popupmenus and could lead to crashes. 
kopete(16059)/kopete (history) HistoryLogger::saveToDisk: 
"/home/kde-dev/.kde/share/apps/kopete/logs/YahooProtocol/XXXX/YYYY.xml"  saved 
in  316  ms
kopete(16059)/libkopete Kopete::Account::~Account:  account ' "XXXX" ' about to 
emit accountDestroyed
kopete(16059)/libkopete Kopete::AccountManager::unregisterAccount: 
Unregistering account  "XXXXX"


- Cristi


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6422/#review9756
-----------------------------------------------------------


On Jan. 29, 2011, 3:46 p.m., Cristi P wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6422/
> -----------------------------------------------------------
> 
> (Updated Jan. 29, 2011, 3:46 p.m.)
> 
> 
> Review request for Kopete.
> 
> 
> Summary
> -------
> 
> while looking for cause of duplicate incoming messages problems, I found some 
> missing code that made program recreate some objects.
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/client.cpp 1217129 
> 
> Diff: http://svn.reviewboard.kde.org/r/6422/diff
> 
> 
> Testing
> -------
> 
> sending messages, sending files still work.
> put some dump in constructor and destructor of a webcamtask to confirm it was 
> not deleting the task but just creating new ones - when reconnecting.
> 
> 
> Thanks,
> 
> Cristi
> 
>

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to