From 93f68d97bf912e963e4390a606d1baaf234b57a5 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Mon, 2 Jan 2012 14:55:55 -0500 Subject: [PATCH] ProcessController: fix a small resource leak fSettingsFile wasn't deleted in the destructor. CID 1414. --- src/apps/processcontroller/Preferences.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/processcontroller/Preferences.cpp b/src/apps/processcontroller/Preferences.cpp index e7ca2c4693..15b49d9dba 100644 --- a/src/apps/processcontroller/Preferences.cpp +++ b/src/apps/processcontroller/Preferences.cpp @@ -91,7 +91,7 @@ Preferences::~Preferences() BFile file; status_t set = B_ERROR; 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 { BPath prefpath; if (find_directory(B_USER_SETTINGS_DIRECTORY, &prefpath, true) == B_OK) { @@ -121,6 +121,7 @@ Preferences::~Preferences() alert->Go(); } } + delete fSettingsFile; free(fName); free(fSignature); }