Fix memory leak + style cleanup. Thanks Axel!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38787 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2010-09-22 11:23:14 +00:00
parent c1e73fbf52
commit 30c47afa79
3 changed files with 5 additions and 3 deletions

View File

@ -247,7 +247,7 @@ Debugger::MessageReceived(BMessage* message)
fTeamsWindow = TeamsWindow::Create(&fSettingsManager);
if (fTeamsWindow != NULL)
fTeamsWindow->Show();
} catch(...) {
} catch (...) {
// TODO: Notify the user!
fprintf(stderr, "Error: Failed to create Teams window\n");
}

View File

@ -3,6 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <new>
#include <stdio.h>
@ -245,7 +246,7 @@ TeamsListView::MessageReceived(BMessage* message)
TeamListItem* item = new(std::nothrow) TeamListItem(team);
if (item != NULL) {
AddItem(new TeamListItem(team));
AddItem(item);
SortItems(&TeamListItem::Compare);
}
break;

View File

@ -3,6 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <new>
#include <stdio.h>
@ -44,7 +45,7 @@ TeamsWindow::Create(SettingsManager* settingsManager)
try {
self->_Init();
} catch(...) {
} catch (...) {
delete self;
throw;
}