Skip to content

Commit

Permalink
fix crash on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
n115 committed Nov 22, 2022
1 parent 556805d commit 3e18c96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RemoteCaptury.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,7 @@ extern "C" int Captury_connect2(const char* ip, unsigned short port, unsigned sh
{
#ifdef WIN32
InitializeCriticalSection(&mutex);
InitializeCriticalSection(&partialActorMutex);
#endif

if (sock == -1) {
Expand Down Expand Up @@ -1652,16 +1653,16 @@ extern "C" CapturyPose* Captury_getCurrentPoseAndTrackingConsistencyForActor(int
lastErrorMessage += buf;
}
unlockMutex(&mutex);
return 0;
return NULL;
}

if (it->second.currentPose.numTransforms == 0) {
unlockMutex(&mutex);
lastErrorMessage = "most recent pose is empty";
return 0;
return NULL;
}

CapturyPose* pose = (CapturyPose*) malloc(sizeof(CapturyPose) + it->second.currentPose.numTransforms * sizeof(float) * 6);
CapturyPose* pose = (CapturyPose*)malloc(sizeof(CapturyPose) + it->second.currentPose.numTransforms * sizeof(float) * 6);
pose->actor = actorId;
pose->timestamp = it->second.currentPose.timestamp;
pose->numTransforms = it->second.currentPose.numTransforms;
Expand Down

0 comments on commit 3e18c96

Please sign in to comment.