Overview
Features
Download
Documentation
Community
Add-Ons & Services

Using SessionPool AutoPtr in Poco 1.4.6 // avoiding leaks

Please post support and help requests here.

Using SessionPool AutoPtr in Poco 1.4.6 // avoiding leaks

Postby kah » 28 May 2013, 21:52

I've been attempting to use the AutoPtr for a SessionPool, however I get the following error:

error: class 'Poco::Data:SessionPool' has no member named 'release'

sometimes I get an error for other methods such as 'duplicate' depending on what I do.

My real issue is to avoid memory leaks. I want to do this by using sessions from a global session pool. We have to share sessions between classes, so the use of ptrs is important for safe code. I see that I can use a SessionPoolContainer in 1.5, but for now we are trying to get 1.4.6 to work.

Any ideas?

Thanks!
kah
 
Posts: 1
Joined: 28 May 2013, 21:29

Re: Using SessionPool AutoPtr in Poco 1.4.6 // avoiding lea

Postby guenter » 29 May 2013, 09:51

Poco::AutoPtr requires that the class supports reference counting with duplicate() and release() methods. Typically, these are classes derived from Poco::RefCountedObject (but this is not required). For other classes, such as Poco::Data::SessionPool, use Poco::SharedPtr.
guenter
 
Posts: 1119
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests