c++ - Singleton class pointer assignment doesn't work -
c++ - Singleton class pointer assignment doesn't work -
i have class abc singleton.(this c++) when
abc *b = abc::getinstance(); abc* a; a=b; then when check in debugger value of b not assigned a.
in debugger value of shown 0x00000000 , garbage values members of abc (vs 2008 debugger)
i did *b in debugger watch window , see valid values, when *a see null , garbage values (this after above process over)
a , b pointers.
the address point same, although specific address different.
one other reason might you're debugging in release mode, , you're not using variable a afterwards. in case, compiler can decide omit declaration , assignment of a.
c++ singleton
Comments
Post a Comment