Changeset 210 for trunk/nom/class_c/nomcls.c
- Timestamp:
- Jan 21, 2007, 4:58:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nom/class_c/nomcls.c
r208 r210 49 49 #include "nomclassmanager.h" 50 50 51 #include "gc.h" 52 51 53 extern NOMClassMgr* NOMClassMgrObject; 52 54 55 static void nomObjectFinalizer(GC_PTR obj, GC_PTR client_data) 56 { 57 NOMObject* nObj; 58 nObj=(NOMObject*)obj; 59 60 if(nomIsObj(nObj)){ 61 //nomPrintf("Finalizing 0x%x: %s \n", nObj, nObj->mtab->nomClassName); 62 _nomUnInit(nObj, NULLHANDLE); 63 } 64 //else 65 //nomPrintf("Finalizing 0x%x: no object! \n", nObj); 66 } 53 67 54 68 NOM_Scope CORBA_Object NOMLINK impl_NOMClass_nomNew(NOMClass* nomSelf, CORBA_Environment *ev) … … 56 70 NOMClassData* nomThis=NOMClassGetData(nomSelf); 57 71 NOMClassPriv *ncp; 58 string nObj; 59 60 //nomPrintf(" Entering %s (%x) with nomSelf: 0x%x. nomSelf is: %s.\n", 61 // __FUNCTION__, impl_NOMClass_nomNew, nomSelf, nomSelf->mtab->nomClassName); 72 gchar* nObj; 62 73 63 74 if(!nomSelf) 64 75 return NULLHANDLE; 65 66 76 67 77 if(!_ncpObject) … … 83 93 NOMClassPriv *ncp; 84 94 NOMClassData *nomThis = NOMClassGetData(nomSelf); 95 GC_PTR oldData; 96 GC_finalization_proc oldFinalizerFunc; 85 97 86 98 ncp=(NOMClassPriv*)_ncpObject; … … 92 104 ((NOMObject*)nomObj)->mtab=ncp->mtab; 93 105 106 /* Register finalizer if the class uses nomUnInit */ 107 ncp=(NOMClassPriv*)ncp->mtab->nomClsInfo; 108 if(ncp->ulClassFlags & NOM_FLG_NOMUNINIT_OVERRIDEN){ 109 //nomPrintf("Registering finalizer for %s\n", ((NOMObject*)nomObj)->mtab->nomClassName); 110 GC_register_finalizer(nomObj, nomObjectFinalizer, NULL, &oldFinalizerFunc, &oldData); 111 } 94 112 /* NO call to _nomInit() */ 95 113 … … 98 116 } 99 117 100 NOM_Scope CORBA_Object NOMLINK impl_NOMClass_nomRenew(NOMClass* nomSelf, const CORBA_Object nomObj, CORBA_Environment *ev) 118 NOM_Scope CORBA_Object NOMLINK impl_NOMClass_nomRenew(NOMClass* nomSelf, const CORBA_Object nomObj, 119 CORBA_Environment *ev) 101 120 { 102 121 _nomRenewNoInit(nomSelf, nomObj, NULLHANDLE); … … 109 128 110 129 111 NOM_Scope CORBA_string NOMLINK impl_NOMClass_nomAllocate(NOMClass* nomSelf, const CORBA_long ulSize, CORBA_Environment *ev) 112 { 113 NOMClassPriv *ncp; 114 NOMClassData *nomThis = NOMClassGetData(nomSelf); 115 116 ncp=(NOMClassPriv*)_ncpObject; 117 // nomPrintf("%s: size %d\n", __FUNCTION__, ulSize); 130 NOM_Scope CORBA_string NOMLINK impl_NOMClass_nomAllocate(NOMClass* nomSelf, const CORBA_long ulSize, 131 CORBA_Environment *ev) 132 { 133 /* NOMClassData *nomThis = NOMClassGetData(nomSelf); */ 134 118 135 return NOMMalloc(ulSize); 119 136 } … … 131 148 132 149 133 NOM_Scope void NOMLINK impl_NOMClass_nomSetObjectCreateInfo(NOMClass* nomSelf, const gpointer ncpObject, CORBA_Environment *ev) 150 NOM_Scope void NOMLINK impl_NOMClass_nomSetObjectCreateInfo(NOMClass* nomSelf, const gpointer ncpObject, 151 CORBA_Environment *ev) 134 152 { 135 153 NOMClassData* nomThis=NOMClassGetData(nomSelf); … … 178 196 /* No, not in the list, so register it */ 179 197 ncPriv=(NOMClassPriv*)nomSelf->mtab->nomClsInfo; 180 ncPriv->ulIsMetaClass=1; /* Mark that we are a metaclass */ 198 //ncPriv->ulIsMetaClass=1; /* Mark that we are a metaclass */ 199 ncPriv->ulClassFlags|=NOM_FLG_IS_METACLASS; /* Mark that we are a metaclass */ 181 200 _nomRegisterClass(NOMClassMgrObject, nomSelf->mtab, NULLHANDLE); 182 201 /* Register all the methods this class introduces */ … … 193 212 if(ncPriv){ 194 213 #warning !!!!! NOMClass does not have this pointer, this is a bug !!!!! 195 ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */ 214 //ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */ 215 ncPriv->ulClassFlags&=~NOM_FLG_IS_METACLASS; /* Mark that we are not a metaclass (should be 0 already) */ 196 216 _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULLHANDLE); 197 217 … … 214 234 215 235 ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULLHANDLE);//nomSelf->mtab->nomClsInfo; 216 ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */ 236 // ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */ 237 ncPriv->ulClassFlags&=~NOM_FLG_IS_METACLASS; /* Mark that we are not a metaclass (should be 0 already) */ 217 238 if(ncPriv){ 218 239 gulong a, ulNumIntroducedMethods;
Note:
See TracChangeset
for help on using the changeset viewer.