Surface* surface = surfaceIter->second;
surface->removeNotification(senderHandle);
}
+ m_executor->removeApplicationReference(senderHandle);
}
break;
m_ipcModule.appendUint(response, resolution[1]);
m_ipcModule.sendToClients(response, &clientHandle, 1);
m_ipcModule.destroyMessage(response);
+
+ delete [] resolution;
}
void GenericCommunicator::GetNumberOfHardwareLayers(t_ilm_message message)
m_ipcModule.appendUintArray(response, IDs, length);
m_ipcModule.sendToClients(response, &clientHandle, 1);
m_ipcModule.destroyMessage(response);
+ delete [] IDs;
}
void GenericCommunicator::ScreenShot(t_ilm_message message)
m_ipcModule.sendToClients(response, &clientHandle, 1);
m_ipcModule.destroyMessage(response);
+
+ delete [] array;
}
void GenericCommunicator::ListAllSurfaceIDS(t_ilm_message message)
response = m_ipcModule.createResponse(message);
m_ipcModule.appendUintArray(response, array, length);
+ delete [] array;
}
else
{
m_ipcModule.sendToClients(response, &clientHandle, 1);
m_ipcModule.destroyMessage(response);
+
+ delete [] resolution;
}
t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
uint id = 0;
- PixelFormat pixelFormat;
+ PixelFormat pixelFormat = (PixelFormat)ILM_PIXEL_FORMAT_UNKNOWN;
m_ipcModule.getUint(message, &id);
t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
uint id = 0;
- bool visibility;
+ bool visibility = false;
m_ipcModule.getUint(message, &id);
t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
uint id = 0;
- bool visibility;
+ bool visibility = false;
m_ipcModule.getUint(message, &id);
t_ilm_message response;
t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
+
+ // ipcArray was created in ipcModule using malloc (it's implemented C)
+ // so we copy it to a buffer created with new() and discard
+ // the ipcArray using free() to avoid memory corruption
+ uint* ipcArray = NULL;
uint* array = NULL;
int length = 0;
+ m_ipcModule.getUintArray(message, &ipcArray, &length);
+ array = new uint[length];
+ memset(array, 0, length * sizeof(uint));
+ memcpy(array, ipcArray, length * sizeof(uint));
+ free(ipcArray);
+
uint screenID = 0;
- m_ipcModule.getUintArray(message, &array, &length);
m_ipcModule.getUint(message, &screenID);
t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(clientPid, screenID, array, length));
t_ilm_message response;
t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint* array = NULL;
- int length = 0;
- uint layerid = 0;
+ uint layerid = 0;
m_ipcModule.getUint(message, &layerid);
- m_ipcModule.getUintArray(message, &array, &length);
+
+ // ipcArray was created in ipcModule using malloc (it's implemented C)
+ // so we copy it to a buffer created with new() and discard
+ // the ipcArray using free() to avoid memory corruption
+ uint* ipcArray = NULL;
+ uint* array = NULL;
+ int length = 0;
+ m_ipcModule.getUintArray(message, &ipcArray, &length);
+ array = new uint[length];
+ memset(array, 0, length * sizeof(uint));
+ memcpy(array, ipcArray, length * sizeof(uint));
+ free(ipcArray);
t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(clientPid, layerid, array, length));
if (status)