Fixing bug 441923. Stop our SDK sample plugins from crashing on destruction. r+sr=jonas@sicking.cc

This commit is contained in:
Johnny Stenback 2008-06-25 17:00:59 -07:00
Родитель 8df896f622
Коммит f9bac91ffb
5 изменённых файлов: 16 добавлений и 10 удалений

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

@ -95,8 +95,10 @@ nsPluginInstance::~nsPluginInstance()
// so releasing it here does not guarantee that it is over
// we should take precaution in case it will be called later
// and zero its mPlugin member
mScriptablePeer->SetInstance(NULL);
NS_IF_RELEASE(mScriptablePeer);
if (mScriptablePeer) {
mScriptablePeer->SetInstance(NULL);
NS_RELEASE(mScriptablePeer);
}
}
NPBool nsPluginInstance::init(NPWindow* aWindow)

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -126,8 +126,10 @@ nsPluginInstance::~nsPluginInstance()
// so releasing it here does not guarantee that it is over
// we should take precaution in case it will be called later
// and zero its mPlugin member
mScriptablePeer->SetInstance(NULL);
NS_IF_RELEASE(mScriptablePeer);
if (mScriptablePeer) {
mScriptablePeer->SetInstance(NULL);
NS_RELEASE(mScriptablePeer);
}
}
static void

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -93,8 +93,10 @@ nsPluginInstance::~nsPluginInstance()
// so releasing it here does not guarantee that it is over
// we should take precaution in case it will be called later
// and zero its mPlugin member
mScriptablePeer->SetInstance(NULL);
NS_IF_RELEASE(mScriptablePeer);
if (mScriptablePeer) {
mScriptablePeer->SetInstance(NULL);
NS_RELEASE(mScriptablePeer);
}
}
static LRESULT CALLBACK PluginWinProc(HWND, UINT, WPARAM, LPARAM);

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*