Commit 614d104e authored by Damien Fouilleul's avatar Damien Fouilleul

- mozilla: refcounting is still important, don't mess it up during normal operation

parent f0996b77
......@@ -87,43 +87,33 @@ RuntimeNPObject::InvokeResult LibvlcRootNPObject::getProperty(int index, NPVaria
{
case ID_root_audio:
// create child object in lazyman fashion to avoid ownership problem with firefox
if( audioObj )
NPN_RetainObject(audioObj);
else
if( ! audioObj )
audioObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcAudioNPObject>::getClass());
OBJECT_TO_NPVARIANT(audioObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(audioObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_input:
// create child object in lazyman fashion to avoid ownership problem with firefox
if( inputObj )
NPN_RetainObject(inputObj);
else
if( ! inputObj )
inputObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcInputNPObject>::getClass());
OBJECT_TO_NPVARIANT(inputObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(inputObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_log:
// create child object in lazyman fashion to avoid ownership problem with firefox
if( logObj )
NPN_RetainObject(logObj);
else
if( ! logObj )
logObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcLogNPObject>::getClass());
OBJECT_TO_NPVARIANT(logObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(logObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_playlist:
// create child object in lazyman fashion to avoid ownership problem with firefox
if( playlistObj )
NPN_RetainObject(playlistObj);
else
if( ! playlistObj )
playlistObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcPlaylistNPObject>::getClass());
OBJECT_TO_NPVARIANT(playlistObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(playlistObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_video:
// create child object in lazyman fashion to avoid ownership problem with firefox
if( videoObj )
NPN_RetainObject(videoObj);
else
if( ! videoObj )
videoObj = NPN_CreateObject(_instance,RuntimeNPClass<LibvlcVideoNPObject>::getClass());
OBJECT_TO_NPVARIANT(videoObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(videoObj), result);
return INVOKERESULT_NO_ERROR;
case ID_root_VersionInfo:
{
......@@ -1089,11 +1079,9 @@ RuntimeNPObject::InvokeResult LibvlcLogNPObject::getProperty(int index, NPVarian
case ID_log_messages:
{
// create child object in lazyman fashion to avoid ownership problem with firefox
if( messagesObj )
NPN_RetainObject(messagesObj);
else
if( ! messagesObj )
messagesObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcMessagesNPObject>::getClass());
OBJECT_TO_NPVARIANT(messagesObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(messagesObj), result);
return INVOKERESULT_NO_ERROR;
}
case ID_log_verbosity:
......@@ -1369,11 +1357,9 @@ RuntimeNPObject::InvokeResult LibvlcPlaylistNPObject::getProperty(int index, NPV
case ID_playlist_items:
{
// create child object in lazyman fashion to avoid ownership problem with firefox
if( playlistItemsObj )
NPN_RetainObject(playlistItemsObj);
else
if( ! playlistItemsObj )
playlistItemsObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcPlaylistItemsNPObject>::getClass());
OBJECT_TO_NPVARIANT(playlistItemsObj, result);
OBJECT_TO_NPVARIANT(NPN_RetainObject(playlistItemsObj), result);
return INVOKERESULT_NO_ERROR;
}
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment