Software Archive
Read-only legacy content
17061 Discussions

Does Release() call Close(), for a C++ pointer to a PXCSenseManager?

Niels_Dekker
Beginner
507 Views

Is the Close() call in the following code necessary, or is it redundant, as it is followed by Release()?

  PXCSenseManager* myManager = PXCSenseManager::CreateInstance();
  myManager->Init();
  // Usually some more code here...
  // ...

  myManager->Close();
  myManager->Release();

 

In general, when myManager is a pointer to a valid PXCSenseManager object, does myManager->Release() internally call myManager->Close()?

 

Note that I posted a similar question regarding C#, two days ago: Does C# PXCMSenseManager.Dispose() call PXCMSenseManager.Close()? But I guess the answer might be different.

Kind regards, Niels
--
Niels Dekker
Scientific programmer at LKEB
Leiden University Medical Center

0 Kudos
1 Reply
samontab
Valued Contributor II
507 Views

Interesting. There are two methods called Close() in the docs:

close() is listed as part of the Java interface in the docs:

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?member_functions_pxcbase.html

There is another method called Close() in C++:

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?close_pxcsensemanager.html

I guess you are referring to this Close() method, which is for terminating the StreamFrames thread.

My guess would be that Release() does not call Close(), since you may not be using StreamFrames() at all. You may just directly use pairs of AcquireFrame/ReleaseFrame calls in your own thread. So there would be no need to call Close() in that use case, but you always need to pair CreateInstance() with Release() in C++

0 Kudos
Reply