ProcessController: fix a small resource leak
fSettingsFile wasn't deleted in the destructor. CID 1414.
This commit is contained in:
@@ -91,7 +91,7 @@ Preferences::~Preferences()
|
|||||||
BFile file;
|
BFile file;
|
||||||
status_t set = B_ERROR;
|
status_t set = B_ERROR;
|
||||||
if (fSettingsFile)
|
if (fSettingsFile)
|
||||||
file.SetTo (fSettingsFile, B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
|
file.SetTo(fSettingsFile, B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
|
||||||
else {
|
else {
|
||||||
BPath prefpath;
|
BPath prefpath;
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &prefpath, true) == B_OK) {
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &prefpath, true) == B_OK) {
|
||||||
@@ -121,6 +121,7 @@ Preferences::~Preferences()
|
|||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete fSettingsFile;
|
||||||
free(fName);
|
free(fName);
|
||||||
free(fSignature);
|
free(fSignature);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user