зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1102223 - Wrapping |aWrappedParameters| before checking for shutdown to prevent memory leaks; r=Dexter,Yoric
This commit is contained in:
Родитель
1f16bc5c5e
Коммит
7dea17ee6f
|
@ -565,14 +565,14 @@ NativeFileWatcherIOTask::AddPathRunnableMethod(
|
|||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
nsAutoPtr<PathRunnablesParametersWrapper> wrappedParameters(aWrappedParameters);
|
||||
|
||||
// We return immediately if |mShuttingDown| is true (see below for
|
||||
// details about the shutdown protocol being followed).
|
||||
if (mShuttingDown) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoPtr<PathRunnablesParametersWrapper> wrappedParameters(aWrappedParameters);
|
||||
|
||||
if (!wrappedParameters ||
|
||||
!wrappedParameters->mChangeCallbackHandle) {
|
||||
FILEWATCHERLOG("NativeFileWatcherIOTask::AddPathRunnableMethod - Invalid arguments.");
|
||||
|
@ -735,14 +735,14 @@ NativeFileWatcherIOTask::RemovePathRunnableMethod(
|
|||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
nsAutoPtr<PathRunnablesParametersWrapper> wrappedParameters(aWrappedParameters);
|
||||
|
||||
// We return immediately if |mShuttingDown| is true (see below for
|
||||
// details about the shutdown protocol being followed).
|
||||
if (mShuttingDown) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoPtr<PathRunnablesParametersWrapper> wrappedParameters(aWrappedParameters);
|
||||
|
||||
if (!wrappedParameters ||
|
||||
!wrappedParameters->mChangeCallbackHandle) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
|
Загрузка…
Ссылка в новой задаче