mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 559349 - nsNPAPIPluginInstance::ScheduleTimer leaks newTimer when do_CreateInstance fails, r=jst
--HG-- extra : rebase_source : 7766f8a1a3eadcb2e034741d5624d1347fd1edca
This commit is contained in:
parent
0729741b2a
commit
63a9e73cef
@ -1749,8 +1749,10 @@ nsNPAPIPluginInstance::ScheduleTimer(uint32_t interval, NPBool repeat, void (*ti
|
||||
// create new xpcom timer, scheduled correctly
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsITimer> xpcomTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
if (NS_FAILED(rv)) {
|
||||
delete newTimer;
|
||||
return 0;
|
||||
}
|
||||
const short timerType = (repeat ? (short)nsITimer::TYPE_REPEATING_SLACK : (short)nsITimer::TYPE_ONE_SHOT);
|
||||
xpcomTimer->InitWithFuncCallback(PluginTimerCallback, newTimer, interval, timerType);
|
||||
newTimer->timer = xpcomTimer;
|
||||
|
Loading…
Reference in New Issue
Block a user