Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » PostgreSQL Session.Open Leak??
Re: PostgreSQL Session.Open Leak?? [message #14283 is a reply to message #14281] Thu, 21 February 2008 16:28 Go to previous messageGo to previous message
indiocolifa is currently offline  indiocolifa
Messages: 49
Registered: January 2008
Location: Argentina
Member
luzr wrote on Thu, 21 February 2008 13:14

indiocolifa wrote on Thu, 21 February 2008 09:49

Yesss,,,, fixed it!

The last line of main is now:

delete G_STATE;


G_STATE is a macro so, it's equal to:

delete globalState::getInst();


since getInst returns a pointer, it's all ok.


Well, well, that is the price of NOT using U++ way od programming:)

We have nice Single template.

Remove these statics and just use Single<GlobalState>() instead of GlobalState::getInst. Also, your version is MT broken (depends on compiler); Single is guaranteed to work.

No well-behaved program should contain similar "delete" Smile

Mirek



Hey Mirek, great!

Should I define Globalstate as a normal class (I mean, not using statics like in the Singleton pattern)?

Discovering U++ is fun!
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: updating/discarding table data on dialogs...
Next Topic: Can't fetch row...
Goto Forum:
  


Current Time: Sat Jun 08 21:25:23 CEST 2024

Total time taken to generate the page: 0.02025 seconds