Revision: 8842
http://playerstage.svn.sourceforge.net/playerstage/?rev=8842&view=rev
Author: jpgr87
Date: 2010-07-30 22:22:24 +0000 (Fri, 30 Jul 2010)
Log Message:
-----------
Applied patch #3037148: Player: Fix allocation bug in fakelocalize driver
Modified Paths:
--------------
code/player/trunk/server/drivers/localization/fakelocalize.cc
Modified: code/player/trunk/server/drivers/localization/fakelocalize.cc
===================================================================
--- code/player/trunk/server/drivers/localization/fakelocalize.cc
2010-07-30 15:16:51 UTC (rev 8841)
+++ code/player/trunk/server/drivers/localization/fakelocalize.cc
2010-07-30 22:22:24 UTC (rev 8842)
@@ -400,8 +400,7 @@
resp.variance = 0;
resp.particles_count = 1;
- // TODO: Potential boom! resp.particles_count hasn't been initialised
yet!
- // Someone who understands what this driver is doing should fix this.
+ resp.particles = new player_localize_particle[resp.particles_count];
for(uint32_t i=0;i<resp.particles_count;i++)
{
resp.particles[i].pose.px = ans->pose.px;
@@ -412,6 +411,8 @@
this->Publish(this->localize_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_LOCALIZE_REQ_GET_PARTICLES, (void*)&resp,
sizeof(resp), NULL);
+ delete[] resp.particles;
+ resp.particles = NULL;
delete Reply;
Reply = NULL;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit