pkg: Fix recursion in Install destructor.

Prevent creating a shared pointer from this in
destructor, which would lead to recursively
calling the descructor.
This commit is contained in:
Thomas Geymayer 2014-06-12 23:21:56 +02:00
parent edbfbd769e
commit e8f10dd2e8
2 changed files with 4 additions and 4 deletions

View File

@ -356,7 +356,7 @@ void Catalog::refreshComplete(Delegate::FailureCode aReason)
m_root->catalogRefreshComplete(this, aReason); m_root->catalogRefreshComplete(this, aReason);
} }
void Catalog::registerInstall(InstallRef ins) void Catalog::registerInstall(Install* ins)
{ {
if (!ins || ins->package()->catalog() != this) { if (!ins || ins->package()->catalog() != this) {
return; return;
@ -365,7 +365,7 @@ void Catalog::registerInstall(InstallRef ins)
m_installed[ins->package()] = ins; m_installed[ins->package()] = ins;
} }
void Catalog::unregisterInstall(InstallRef ins) void Catalog::unregisterInstall(Install* ins)
{ {
if (!ins || ins->package()->catalog() != this) { if (!ins || ins->package()->catalog() != this) {
return; return;

View File

@ -124,8 +124,8 @@ private:
friend class Downloader; friend class Downloader;
friend class Install; friend class Install;
void registerInstall(InstallRef ins); void registerInstall(Install* ins);
void unregisterInstall(InstallRef ins); void unregisterInstall(Install* ins);
void parseProps(const SGPropertyNode* aProps); void parseProps(const SGPropertyNode* aProps);