Browse Source

Merge pull request #415 from Hoikas/coverity

Fix moar leeks
Adam Johnson 11 years ago
parent
commit
3b8ad7eabf
  1. 29
      Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp
  2. 15
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

29
Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp

@ -176,25 +176,16 @@ void cyCamera::ControlKey(int32_t controlKey, bool activated)
//
void cyCamera::TransitionTo(pyKey& newCamKey, double time, bool save)
{
// create message
if (fTheCam) {
plCameraMsg* pMsg = new plCameraMsg;
if ( fSender )
if (fSender)
pMsg->SetSender(fSender);
// must have a receiver!
if ( fTheCam )
{
pMsg->AddReceiver(fTheCam);
// set command to do the transition
pMsg->SetCmd(plCameraMsg::kTransitionTo);
// set the new camera
pMsg->SetNewCam(newCamKey.getKey());
// set the transition time
pMsg->SetTransTime(time);
// test to see if they want to save
if ( save )
if (save)
pMsg->SetCmd(plCameraMsg::kPush);
plgDispatch::MsgSend( pMsg ); // whoosh... off it goes
pMsg->Send(fTheCam);
}
}
@ -221,18 +212,12 @@ void cyCamera::SetEnableFirstPersonOverride(bool state) const
void cyCamera::UndoFirstPerson()
{
// create message
if (fTheCam) {
plCameraMsg* pMsg = new plCameraMsg;
if ( fSender )
if (fSender)
pMsg->SetSender(fSender);
// must have a receiver!
if ( fTheCam )
{
pMsg->AddReceiver(fTheCam);
// set command to do the transition
pMsg->SetCmd(plCameraMsg::kPythonUndoFirstPerson);
plgDispatch::MsgSend( pMsg ); // whoosh... off it goes
pMsg->Send(fTheCam);
}
}

15
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -722,17 +722,16 @@ void plNetLinkingMgr::LinkToPlayersAge( uint32_t playerID )
void plNetLinkingMgr::OfferLinkToPlayer( const plAgeLinkStruct * inInfo, uint32_t playerID )
{
plNetClientMgr *mgr = plNetClientMgr::GetInstance();
plLinkToAgeMsg * linkM = new plLinkToAgeMsg(inInfo);
plNetClientMgr* mgr = plNetClientMgr::GetInstance();
plNetTransport& transport = mgr->TransportMgr();
int guestIdx = transport.FindMember(playerID);
plNetTransportMember* guestMem = transport.GetMember(guestIdx); // -1 ?
if (guestMem) {
plLinkToAgeMsg* linkM = new plLinkToAgeMsg(inInfo);
linkM->AddReceiver(mgr->GetKey());
plKey host = mgr->GetLocalPlayerKey();
plNetTransport &transport = mgr->TransportMgr();
int guestIdx = transport.FindMember(playerID);
plNetTransportMember *guestMem = transport.GetMember(guestIdx); // -1 ?
if(guestMem)
{
plKey guest = guestMem->GetAvatarKey();
plAvatarMgr::OfferLinkingBook(host, guest, linkM, host);
}

Loading…
Cancel
Save