NodePreloader.cpp: fix memory leak.
Signed-off-by: Adrien Destugues <[email protected]> Fixes #13115.
This commit is contained in:
committed by
Adrien Destugues
parent
b4896fbf3b
commit
b50d53dd19
@@ -57,8 +57,10 @@ NodePreloader::InstallNodePreloader(const char* name, BLooper* host)
|
|||||||
NodePreloader* result = new NodePreloader(name);
|
NodePreloader* result = new NodePreloader(name);
|
||||||
{
|
{
|
||||||
AutoLock<BLooper> lock(host);
|
AutoLock<BLooper> lock(host);
|
||||||
if (!lock)
|
if (!lock) {
|
||||||
|
delete result;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
host->AddHandler(result);
|
host->AddHandler(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user