mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1150197 - Remove useless null checks after allocating memory with new from xpcom/threads/; r=froydnj
This commit is contained in:
parent
d18985cfe1
commit
ce96843aa0
@ -28,9 +28,6 @@ nsEnvironment::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
|
||||
}
|
||||
|
||||
nsEnvironment* obj = new nsEnvironment();
|
||||
if (!obj) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
rv = obj->QueryInterface(aIID, aResult);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -559,9 +559,6 @@ nsThread::DispatchInternal(nsIRunnable* aEvent, uint32_t aFlags,
|
||||
|
||||
nsRefPtr<nsThreadSyncDispatch> wrapper =
|
||||
new nsThreadSyncDispatch(thread, aEvent);
|
||||
if (!wrapper) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsresult rv = PutEvent(wrapper, aTarget);
|
||||
// Don't wait for the event to finish if we didn't dispatch it...
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -639,9 +636,6 @@ nsThread::Shutdown()
|
||||
// Set mShutdownContext and wake up the thread in case it is waiting for
|
||||
// events to process.
|
||||
nsCOMPtr<nsIRunnable> event = new nsThreadShutdownEvent(this, &context);
|
||||
if (!event) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
// XXXroc What if posting the event fails due to OOM?
|
||||
PutEvent(event, nullptr);
|
||||
|
||||
|
@ -304,9 +304,6 @@ nsTimerImpl::Startup()
|
||||
nsTimerEvent::Init();
|
||||
|
||||
gThread = new TimerThread();
|
||||
if (!gThread) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_ADDREF(gThread);
|
||||
rv = gThread->InitLocks();
|
||||
@ -827,9 +824,6 @@ NS_NewTimer(nsITimer** aResult, nsTimerCallbackFunc aCallback, void* aClosure,
|
||||
uint32_t aDelay, uint32_t aType)
|
||||
{
|
||||
nsTimerImpl* timer = new nsTimerImpl();
|
||||
if (!timer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
NS_ADDREF(timer);
|
||||
|
||||
nsresult rv = timer->InitWithFuncCallback(aCallback, aClosure,
|
||||
|
Loading…
Reference in New Issue
Block a user