内存泄漏——急需求助!
大家帮忙解释一下这段代码有两处内存泄漏,具体点啊!谢谢!
static void UiHandleAccEvents(RegIdT /*RegId*/, uint32 MsgId, void *MsgBufferP)
{
uint32 UiMsgId = 0;}
uint8 *MailMsgP = (uint8 *)ExeMsgBufferGet(sizeof(uint8));
*MailMsgP = *((uint8 *)MsgBufferP);
switch(MsgId)
{
case VAL_ACC_STATUS_CONNECTED:
UiMsgId = APPMSG_UILIFECYCLE_ACC_CONNECT;
break;
case VAL_ACC_STATUS_REMOVED:
UiMsgId = APPMSG_UILIFECYCLE_ACC_REMOVE;
break;
default:
return; //invalid message
}
AslTurnLightOn(FALSE);
ExeMsgSend(EXE_UI_ID, EXE_MAILBOX_1_ID, UiMsgId, MailMsgP, sizeof(uint8));
}
static void UiHandleBatteryEvents(RegIdT /*RegId*/, uint32 MsgId, void *MsgBufferP)
{
uint32 UiMsgId = 0;
uint8 *MailMsgP = (uint8 *)ExeMsgBufferGet(sizeof(uint8));
*MailMsgP = *((uint8 *)MsgBufferP);
switch(MsgId)
{
case VAL_BATT_CAPACITY:
UiMsgId = APPMSG_UILIFECYCLE_BATTERY_LEVEL;
break;
case VAL_BATT_CHARGE_STATE:
UiMsgId = APPMSG_UILIFECYCLE_BATTERY_STATUS;
break;
default:
return; //invalid message
}
ExeMsgSend(EXE_UI_ID, EXE_MAILBOX_1_ID, UiMsgId, MailMsgP, sizeof(uint8));
}
[[it] 本帖最后由 xxjjyy2008 于 2008-9-18 13:35 编辑 [/it]]