Skip to content

Commit

Permalink
Free GPS resource on stop (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
danthony06 committed May 10, 2024
1 parent a07f8d9 commit b944a42
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gpsd_client/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ using namespace sensor_msgs;

class GPSDClient {
public:
GPSDClient() : privnode("~"), gps(NULL), use_gps_time(true), check_fix_by_variance(true), frame_id("gps") {}
GPSDClient() :
privnode("~"),
gps(NULL),
use_gps_time(true),
check_fix_by_variance(true),
frame_id("gps") {}

bool start() {
gps_fix_pub = node.advertise<GPSFix>("extended_fix", 1);
Expand Down Expand Up @@ -73,6 +78,10 @@ class GPSDClient {

void stop() {
// gpsmm doesn't have a close method? OK ...
if (gps != NULL)
{
delete gps;
}
}

private:
Expand Down

0 comments on commit b944a42

Please sign in to comment.