mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-10-09 00:09:58 +00:00
Fixed memory leak
This commit is contained in:
@@ -85,17 +85,21 @@ bool AzureKinectCapture::AcquireFrame()
|
||||
k4a_wait_result_t captureResult = k4a_device_get_capture(kinectSensor, &capture, captureTimeoutMs);
|
||||
if (captureResult != K4A_WAIT_RESULT_SUCCEEDED)
|
||||
{
|
||||
k4a_capture_release(capture);
|
||||
return false;
|
||||
}
|
||||
|
||||
k4a_image_release(colorImage);
|
||||
k4a_image_release(depthImage);
|
||||
|
||||
|
||||
colorImage = k4a_capture_get_color_image(capture);
|
||||
depthImage = k4a_capture_get_depth_image(capture);
|
||||
if (colorImage == NULL || depthImage == NULL)
|
||||
{
|
||||
k4a_capture_release(capture);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (pColorRGBX == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user