Assign new value to _tempProfile in a way clearly indicating its type.

This avoids potential doubt about its type and memory leak.
This commit is contained in:
Jekyll Wu
2011-09-04 00:13:25 +08:00
parent 0e184eeda9
commit dec20a58a7

View File

@@ -90,7 +90,7 @@ EditProfileDialog::EditProfileDialog(QWidget* parent)
connect( _ui->tabWidget , SIGNAL(currentChanged(int)) , this ,
SLOT(preparePage(int)) );
_tempProfile = new Profile;
_tempProfile = Profile::Ptr(new Profile);
_tempProfile->setHidden(true);
}
EditProfileDialog::~EditProfileDialog()
@@ -113,7 +113,7 @@ void EditProfileDialog::save()
_previewedProperties.remove(iter.key());
}
_tempProfile = new Profile ;
_tempProfile = Profile::Ptr(new Profile);
_tempProfile->setHidden(true);
enableButtonApply(false);
}
@@ -178,7 +178,7 @@ void EditProfileDialog::setProfile(Profile::Ptr profile)
if ( _tempProfile )
{
_tempProfile = new Profile;
_tempProfile = Profile::Ptr(new Profile);
}
}
const Profile::Ptr EditProfileDialog::lookupProfile() const