Click here to Skip to main content
15,914,070 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSuspend layout [modified] Pin
baerten23-Oct-06 21:50
baerten23-Oct-06 21:50 
AnswerRe: Suspend layout Pin
Naveen24-Oct-06 0:42
Naveen24-Oct-06 0:42 
GeneralRe: Suspend layout Pin
baerten24-Oct-06 2:28
baerten24-Oct-06 2:28 
Questiontab order Pin
Desmo1623-Oct-06 21:45
Desmo1623-Oct-06 21:45 
AnswerRe: tab order Pin
tanvon malik23-Oct-06 21:59
tanvon malik23-Oct-06 21:59 
AnswerRe: tab order Pin
fat_boy23-Oct-06 23:40
fat_boy23-Oct-06 23:40 
QuestionProblem to call destructor Pin
ascom223-Oct-06 20:29
ascom223-Oct-06 20:29 
AnswerRe: Problem to call destructor Pin
Cedric Moonen23-Oct-06 20:41
Cedric Moonen23-Oct-06 20:41 
It is because you never destroy your pointer (_instance). There is a new but no delete associated. You need to add a 'destroy' public method to your singleton that will delete the pointer. And you need to call this function at the end of your program (or when you want to delete your singleton).

Another way of doing that (and you won't need to manage the memory yourself) is to use this init method instead (still static method):

Singleton* Singleton::Init()<br />
{<br />
   static Singleton Instance;<br />
   return &Instance;<br />
}


Of course, you can remove your static pointer.

BTW: when you post code, please use the code or pre tags so that it is more readable.


Cédric Moonen
Software developer

Charting control [Updated - v1.1]

GeneralRe: Problem to call destructor Pin
ascom223-Oct-06 20:55
ascom223-Oct-06 20:55 
Questiondata is printed on the scroll bar Pin
prithaa23-Oct-06 20:06
prithaa23-Oct-06 20:06 
AnswerRe: data is printed on the scroll bar Pin
tanvon malik23-Oct-06 20:18
tanvon malik23-Oct-06 20:18 
GeneralRe: data is printed on the scroll bar Pin
prithaa23-Oct-06 20:28
prithaa23-Oct-06 20:28 
GeneralRe: data is printed on the scroll bar Pin
tanvon malik23-Oct-06 20:54
tanvon malik23-Oct-06 20:54 
GeneralRe: data is printed on the scroll bar Pin
prithaa23-Oct-06 20:56
prithaa23-Oct-06 20:56 
GeneralRe: data is printed on the scroll bar Pin
tanvon malik23-Oct-06 21:47
tanvon malik23-Oct-06 21:47 
GeneralRe: data is printed on the scroll bar Pin
prithaa23-Oct-06 22:10
prithaa23-Oct-06 22:10 
GeneralRe: data is printed on the scroll bar Pin
Mark Salsbery24-Oct-06 4:40
Mark Salsbery24-Oct-06 4:40 
GeneralRe: data is printed on the scroll bar Pin
prithaa24-Oct-06 5:11
prithaa24-Oct-06 5:11 
GeneralRe: data is printed on the scroll bar Pin
Mark Salsbery24-Oct-06 5:55
Mark Salsbery24-Oct-06 5:55 
GeneralRe: data is printed on the scroll bar Pin
prithaa24-Oct-06 6:46
prithaa24-Oct-06 6:46 
Questionhi this problem with my detours i cant ddetour it it gives errors Pin
nah133723-Oct-06 19:22
nah133723-Oct-06 19:22 
AnswerRe: hi this problem with my detours i cant ddetour it it gives errors Pin
Cedric Moonen23-Oct-06 20:47
Cedric Moonen23-Oct-06 20:47 
AnswerRe: hi this problem with my detours i cant ddetour it it gives errors [modified] Pin
nah133723-Oct-06 21:25
nah133723-Oct-06 21:25 
GeneralRe: hi this problem with my detours i cant ddetour it it gives errors Pin
Cedric Moonen23-Oct-06 21:38
Cedric Moonen23-Oct-06 21:38 
GeneralRe: hi this problem with my detours i cant ddetour it it gives errors Pin
nah133724-Oct-06 1:22
nah133724-Oct-06 1:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.