* 2012.02.20 : Create
*/
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
OMX_U32 IONBuffer;
OMX_PTR mapAddr;
OMX_U32 allocSize;
+ bool owner;
struct _EXYNOS_SHAREDMEM_LIST *pNextMemory;
} EXYNOS_SHAREDMEM_LIST;
pDeleteElement->mapAddr = NULL;
pDeleteElement->allocSize = 0;
- ion_free(pDeleteElement->IONBuffer);
+ if (pDeleteElement->owner)
+ ion_free(pDeleteElement->IONBuffer);
pDeleteElement->IONBuffer = 0;
Exynos_OSAL_Free(pDeleteElement);
pElement = (EXYNOS_SHAREDMEM_LIST *)Exynos_OSAL_Malloc(sizeof(EXYNOS_SHAREDMEM_LIST));
Exynos_OSAL_Memset(pElement, 0, sizeof(EXYNOS_SHAREDMEM_LIST));
+ pElement->owner = true;
switch (memoryType) {
case SECURE_MEMORY:
pDeleteElement->mapAddr = NULL;
pDeleteElement->allocSize = 0;
- ion_free(pDeleteElement->IONBuffer);
+ if (pDeleteElement->owner)
+ ion_free(pDeleteElement->IONBuffer);
pDeleteElement->IONBuffer = 0;
Exynos_OSAL_Free(pDeleteElement);