标题:内存泄漏——急需求助!
只看楼主
xxjjyy2008
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-7-25
 问题点数:0 回复次数:0 
内存泄漏——急需求助!
大家帮忙解释一下这段代码有两处内存泄漏,具体点啊!
谢谢!

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]]
搜索更多相关主题的帖子: 内存 泄漏 
2008-09-18 13:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-233786-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013702 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved