FACT++  1.0
JNIEXPORT void JNICALL Java_dim_Client_releaseService ( JNIEnv *  env,
jclass  This,
jint  sid 
)

Definition at line 1077 of file dim_jni.c.

References dic_release_service(), id_get_ptr(), Java_dim_Client_noPadding(), SRC_DIC, dic_serv::tag, and dic_serv::user_routine.

Referenced by Java_dim_DimTimer_stop().

1078 {
1079 
1080  DIC_SERVICE *servp;
1081 
1082 // DBGe(dim_Dbg_INFO_SERVICE) ; /* Trap only, report later */
1083 
1084  if(This){}
1085  servp = (DIC_SERVICE *)id_get_ptr(sid, SRC_DIC);
1086 
1087 /*
1088 Hans Essel, 3.12.08
1089 Without deleting the global reference, the Java GC could not free the object!
1090 Any DimInfo object would stay forever. This is a memory leak.
1091 */
1092  if(servp != NULL)
1093  {
1094  // DBGx(dim_Dbg_INFO_SERVICE) printf("DimJNI: Client.releaseService(%d (%s))\n", sid, servp->serv_name);
1095  servp->user_routine = NULL; // make sure this is not called anymore
1096  (*env)->DeleteGlobalRef(env, (jobject) servp->tag);
1097  servp->tag = 0;
1098  }
1099 
1100  dic_release_service(sid);
1101  return;
1102 }
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
void(* user_routine)()
Definition: dim.h:472
dim_long tag
Definition: dim.h:473
Definition: dim.h:457
void dic_release_service(unsigned service_id)
Definition: dic.c:1025

+ Here is the call graph for this function:

+ Here is the caller graph for this function: