Crash in KXMLGUIFactory (with patch)

Simon Hausmann hausmann at kde.org
Sun Nov 30 15:36:43 GMT 2003


On Sun, Nov 30, 2003 at 04:32:15PM +0100, Olivier Goffart wrote:
> Hello, 
> I don't know if i do something bad in my application or if it's a bug in the 
> kxmlgui system. But if it's a bug in kxmlgui , here is a patch that fix it.
> 
> Here is the problem.
> In Kopete, Plugins can add actions in the chatwindow. This is done via the 
> XMLGUI system, and transparently.  When a chatwindow is closed, the object 
> which inerits  from KXMLGUIClient may or may not be deleted (depends of some 
> socket activity, ...) And if a new chat window is open if it's not deleted, 
> we automaticaly reuse it. And we can see sometimes a crash.
> 
> The reason:
> In KXMLGUIFactory::addClient , if one detect that this client is already 
> plugged in another factory, it removes it from the old factory. The problem 
> is that the old factory has been deleted (with the chatwindow) and the 
> pointer to it hasn't been set to 0L
> 
> Maybe it's a flaw in our kopete system.  (the fact that we shouldn't delete 
> the factory and reuse clients later) 
> But i think that there is no reason to don't allow that, and that's why a 
> suggest a patch to set the pointer to 0L if the factory is deleted.
> 
> Am I allowed to commit?

Looks good to me. Can't hurt.

Simon




More information about the kde-core-devel mailing list