Bug 1102223 - Wrapping |aWrappedParameters| before checking for shutdown to prevent memory leaks; r=Dexter,Yoric

This commit is contained in:
Nihar Mehta 2014-12-11 03:45:01 +05:30
Родитель 1f16bc5c5e
Коммит 7dea17ee6f
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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;