Browse Source

ncd: NCDModule: add NCDModuleProcess_AssertFree()

ambrop7 14 years ago
parent
commit
3185994844
2 changed files with 14 additions and 0 deletions
  1. 6 0
      ncd/NCDModule.c
  2. 8 0
      ncd/NCDModule.h

+ 6 - 0
ncd/NCDModule.c

@@ -496,6 +496,12 @@ void NCDModuleProcess_Free (NCDModuleProcess *o)
     NCDValue_Free(&o->args);
 }
 
+void NCDModuleProcess_AssertFree (NCDModuleProcess *o)
+{
+    DebugObject_Access(&o->d_obj);
+    ASSERT(o->state == PROCESS_STATE_TERMINATED)
+}
+
 void NCDModuleProcess_SetSpecialFuncs (NCDModuleProcess *o, NCDModuleProcess_func_getspecialobj func_getspecialobj)
 {
     DebugObject_Access(&o->d_obj);

+ 8 - 0
ncd/NCDModule.h

@@ -426,6 +426,14 @@ int NCDModuleProcess_Init (NCDModuleProcess *o, NCDModuleInst *n, const char *te
  */
 void NCDModuleProcess_Free (NCDModuleProcess *o);
 
+/**
+ * Does nothing.
+ * The process must be in terminated state.
+ * 
+ * @param o the process
+ */
+void NCDModuleProcess_AssertFree (NCDModuleProcess *o);
+
 /**
  * Sets callback functions for providing special objects within the process.
  *