From 1d2cc6faf45f31005b6fd68e095f55a1df0d72ae Mon Sep 17 00:00:00 2001 From: Luc Yriarte Date: Wed, 21 Aug 2013 16:36:10 +0200 Subject: [PATCH] fix private objects management --- src/MediaServer/JSMediaServer.cpp | 4 ++-- src/MediaServer/JSMediaServerManager.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/MediaServer/JSMediaServer.cpp b/src/MediaServer/JSMediaServer.cpp index 1afcc48..768e772 100644 --- a/src/MediaServer/JSMediaServer.cpp +++ b/src/MediaServer/JSMediaServer.cpp @@ -166,7 +166,7 @@ JSValueRef JSMediaServer::browse(JSContextRef context, { LoggerD("Entered JSMediaServer::browse"); // TODO try/catch block - MediaServerPrivObject* privateObject = static_cast(JSObjectGetPrivate(object)); + MediaServerPrivObject* privateObject = static_cast(JSObjectGetPrivate(thisObject)); if (NULL == privateObject) { LoggerE("private object is null"); @@ -211,7 +211,7 @@ JSValueRef JSMediaServer::find(JSContextRef context, { LoggerD("Entered JSMediaServer::find"); // TODO try/catch block - MediaServerPrivObject* privateObject = static_cast(JSObjectGetPrivate(object)); + MediaServerPrivObject* privateObject = static_cast(JSObjectGetPrivate(thisObject)); if (NULL == privateObject) { LoggerE("private object is null"); diff --git a/src/MediaServer/JSMediaServerManager.cpp b/src/MediaServer/JSMediaServerManager.cpp index 80f7818..b34d8fd 100644 --- a/src/MediaServer/JSMediaServerManager.cpp +++ b/src/MediaServer/JSMediaServerManager.cpp @@ -107,13 +107,11 @@ JSValueRef JSMediaServerManager::scanNetwork(JSContextRef context, LoggerD("Entered JSMediaServerManager::scanNetwork"); // TODO try/catch block - MediaServerManagerPrivObject* privateObject = static_cast(JSObjectGetPrivate(object)); + MediaServerManagerPrivObject* privateObject = static_cast(JSObjectGetPrivate(thisObject)); if (NULL == privateObject) { LoggerE("private object is null"); - // FIXME re-doing intialization ? several instances ? - MediaServerManagerPtr mediaservermanager(new MediaServerManager()); - privateObject = new MediaServerManagerPrivObject( context, mediaservermanager); + // TODO post exception } // TODO use event handlers instead of callbacks -- 2.7.4