Software Archive
Read-only legacy content
17061 Discussions

When should we release the instance ?

Hui_L_3
Beginner
494 Views

Hi, 

There're several functions that we could call to get a instance, for example:

CreateInstance()

CreateDevice()

CreateImpl<>()

CreateProjection()

I would like to know when we should release the returned instance or not ? 

If I created a session instance and use session to create capture and sensemanager, what are the relationship between these instances ? 

session = PXCSession::CreateInstance();

session->CreateImpl<PXCCapture>(&capture);

device = capture->CreateDevice(0);

pm = session->CreateSenseManager()

// what are the relationships between session and other instances ? 

 

Can you provide a simple streaming example without using SenseManager ? 

 

Thanks!

0 Kudos
1 Reply
Xusheng_L_Intel
Employee
494 Views

One Session can include multiple SenseManager and SenseManger will include device, projection and multiple impl(MW). We recommend you create the SenseManager first and release SenseManager at the end. When you release SenseManager, it will help you release all the instances it belongs. If you did not use create Session instead of SneseManager, you need release all the instances by yourself. Thanks!

0 Kudos
Reply