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

This avoids potential doubt about its type and memory leak.
wilder-portage
Jekyll Wu 15 years ago
parent 0e184eeda9
commit dec20a58a7
  1. 6
      src/EditProfileDialog.cpp

@ -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

Loading…
Cancel
Save