mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1180993 - Part 3: Correct use sites of functions which return already_AddRefed. r=ehsan
This commit is contained in:
parent
1a947e7297
commit
c1d10743ff
@ -10,6 +10,7 @@
|
||||
#include "mozilla/gfx/DataSurfaceHelpers.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
@ -206,7 +207,7 @@ public:
|
||||
rv = NS_DispatchToMainThread(mEncodingCompleteEvent);
|
||||
if (NS_FAILED(rv)) {
|
||||
// Better to leak than to crash.
|
||||
mEncodingCompleteEvent.forget();
|
||||
unused << mEncodingCompleteEvent.forget();
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ private:
|
||||
// Intentionally leak the runnable (but not the fd) rather
|
||||
// than crash when trying to release a main thread object
|
||||
// off the main thread.
|
||||
mTabParent.forget();
|
||||
mozilla::unused << mTabParent.forget();
|
||||
CloseFile();
|
||||
}
|
||||
}
|
||||
|
@ -423,8 +423,7 @@ nsReverseStringSQLFunction::OnFunctionCall(
|
||||
rv = outVar->SetAsAUTF8String(result);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*aResult = outVar.get();
|
||||
outVar.forget();
|
||||
outVar.forget(aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include <algorithm>
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
|
||||
#define kMinUnwrittenChanges 300
|
||||
@ -3045,7 +3046,7 @@ CacheIndex::FinishUpdate(bool aSucceeded)
|
||||
NS_WARNING(("CacheIndex::FinishUpdate() - Leaking mDirEnumerator!"));
|
||||
// This can happen only in case dispatching event to IO thread failed in
|
||||
// CacheIndex::PreShutdown().
|
||||
mDirEnumerator.forget(); // Leak it since dir enumerator is not threadsafe
|
||||
unused << mDirEnumerator.forget(); // Leak it since dir enumerator is not threadsafe
|
||||
} else {
|
||||
mDirEnumerator->Close();
|
||||
mDirEnumerator = nullptr;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsIXULAppInfo.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -80,7 +81,7 @@ struct ScopedCanberraFile {
|
||||
}
|
||||
|
||||
void forget() {
|
||||
mFile.forget();
|
||||
mozilla::unused << mFile.forget();
|
||||
}
|
||||
nsIFile* operator->() { return mFile; }
|
||||
operator nsIFile*() { return mFile; }
|
||||
|
Loading…
Reference in New Issue
Block a user