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 |
|
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:
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
|
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!
|
|
|
Goto Forum:
Current Time: Sat Jun 08 21:25:23 CEST 2024
Total time taken to generate the page: 0.02025 seconds
|