Skip to content

Commit

Permalink
fix #593: keep device descriptor when closing device
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
  • Loading branch information
piedar committed Sep 17, 2019
1 parent 7cb0d3c commit a64189b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OpenNI2-FreenectDriver/src/DeviceDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace FreenectDriver
return ONI_STATUS_OK;
}
}

OniStatus setProperty(int propertyId, const void* data, int dataSize)
{
switch (propertyId)
Expand Down Expand Up @@ -190,7 +190,7 @@ namespace FreenectDriver
return false;
}
}

OniStatus invoke(int commandId, void* data, int dataSize)
{
switch (commandId)
Expand Down Expand Up @@ -247,7 +247,7 @@ namespace FreenectDriver
std::string uri = devid_to_uri(i);

WriteMessage("Found device " + uri);

OniDeviceInfo info;
strncpy(info.uri, uri.c_str(), ONI_MAX_STR);
strncpy(info.vendor, "Microsoft", ONI_MAX_STR);
Expand Down Expand Up @@ -281,7 +281,7 @@ namespace FreenectDriver
{
return iter->second;
}
else
else
{
WriteMessage("Opening device " + std::string(uri));
int id = uri_to_devid(iter->first.uri);
Expand All @@ -304,7 +304,7 @@ namespace FreenectDriver
{
WriteMessage("Closing device " + std::string(iter->first.uri));
int id = uri_to_devid(iter->first.uri);
devices.erase(iter);
iter->second = NULL;
deleteDevice(id);
return;
}
Expand Down

0 comments on commit a64189b

Please sign in to comment.