Home » U++ Library support » U++ SQL » PostgreSQL Session.Open Leak??
Re: PostgreSQL Session.Open Leak?? [message #14281 is a reply to message #14278] |
Thu, 21 February 2008 16:14   |
 |
mirek
Messages: 14265 Registered: November 2005
|
Ultimate Member |
|
|
indiocolifa wrote on Thu, 21 February 2008 09:49 | Yesss,,,, fixed it!
The last line of main is now:
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" 
Mirek
|
|
|
Goto Forum:
Current Time: Sun Jul 06 11:24:03 CEST 2025
Total time taken to generate the page: 0.04294 seconds
|