*
* This file contains the declarations of the %_ObjectManagerImpl class.
*/
-
-
#ifndef _FBASE_INTERNAL_OBJECT_MANAGER_IMPL_H_
#define _FBASE_INTERNAL_OBJECT_MANAGER_IMPL_H_
#include <FBaseRtMutex.h>
#include <FBaseSysLog.h>
-
namespace Tizen { namespace Base
{
virtual ~_ObjectManagerImpl(void)
{
delete[] __pSlots;
- delete __pLock;
+ //delete __pLock;
}
/**
*
* @since 2.0
*/
- _ObjectManagerImpl(_ObjectManagerImpl& pObjectManagerImpl)
+ _ObjectManagerImpl(_ObjectManagerImpl& objectManagerImpl)
{
- __slotCount = pObjectManagerImpl.__slotCount;
- __slotCapacity = pObjectManagerImpl.__slotCapacity;
- __pSlots = new _HandleElement[pObjectManagerImpl.__slotCapacity];
+ __slotCount = objectManagerImpl.__slotCount;
+ __slotCapacity = objectManagerImpl.__slotCapacity;
+ __pSlots = new _HandleElement[objectManagerImpl.__slotCapacity];
- for (unsigned int i = 0; i < pObjectManagerImpl.__slotCapacity; i++)
+ for (unsigned int i = 0; i < objectManagerImpl.__slotCapacity; i++)
{
- __pSlots[i] = pObjectManagerImpl.__pSlots[i];
+ __pSlots[i] = objectManagerImpl.__pSlots[i];
}
__pLock = new (std::nothrow) Tizen::Base::Runtime::Mutex();
if (index >= __slotCount)
{
+ r = __pLock->Release();
+ SysTryLog(NID_BASE, !IsFailed(r), "Failed to release mutex");
+
SetLastResult(E_OBJ_NOT_FOUND);
return null;
}
_HandleElement& element = __pSlots[index];
if (element.__id != ((_Handle*)&handle)->__id)
{
+ r = __pLock->Release();
+ SysTryLog(NID_BASE, !IsFailed(r), "Failed to release mutex");
+
SetLastResult(E_OBJ_NOT_FOUND);
return null;
}
return pObject;
}
-
/**
* Gets an object specified by the handle.
*
if (index >= __slotCount)
{
+ r = __pLock->Release();
+ SysTryLog(NID_BASE, !IsFailed(r), "Failed to release mutex");
+
SetLastResult(E_OBJ_NOT_FOUND);
return null;
}
const _HandleElement& element = __pSlots[index];
if (element.__id != ((_Handle*)&handle)->__id)
{
+ r = __pLock->Release();
+ SysTryLog(NID_BASE, !IsFailed(r), "Failed to release mutex");
+
SetLastResult(E_OBJ_NOT_FOUND);
return null;
}
return const_cast<void*>(pObj);
}
-
/**
* Gets the number of objects in the object manager.
*
void SetElementAt(int index)
{
-
}
_HandleElement GetElementAt(int index)
Tizen::Base::Runtime::Mutex* __pLock;
};
-
}} // Tizen::Base
-
-#endif // _FBASE_INTERNAL_OBJECT_MANAGER_IMPL_H_
+#endif // _FBASE_INTERNAL_OBJECT_MANAGER_IMPL_H_
\ No newline at end of file