Check-in [fc81c2f879]
Overview
Comment:Fixed reference counting with the "exec" target
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:fc81c2f879da9491c6009cbf91c0bb6dba8d91e5
User & Date: rkeene on 2017-02-22 23:03:59
Other Links: manifest | tags
Context
2017-02-23
22:25
Updated to include TCL_LIBS when trying to link appfs, which may be needed if we are linking statically check-in: d8a575fad2 user: rkeene tags: trunk
2017-02-22
23:03
Fixed reference counting with the "exec" target check-in: fc81c2f879 user: rkeene tags: trunk
23:01
Fixed incorrect usage in README check-in: c987a21cfe user: rkeene tags: trunk
Changes

Modified appfsd.c from [99975a5e76] to [b7dddfc0b8].

  1150   1150   	interp = appfs_TclInterp();
  1151   1151   	if (interp == NULL) {
  1152   1152   		APPFS_DEBUG("Error creating an interpreter.");
  1153   1153   
  1154   1154   		return;
  1155   1155   	}
  1156   1156   
  1157         -	appfs_call_libtcl(scriptObj = Tcl_NewStringObj(script, scriptLen);)
         1157  +	appfs_call_libtcl(
         1158  +		scriptObj = Tcl_NewStringObj(script, scriptLen);
         1159  +
         1160  +		Tcl_IncrRefCount(scriptObj);
         1161  +	)
  1158   1162   
  1159   1163   	if (scriptObj == NULL) {
  1160   1164   		APPFS_DEBUG("Error creating a script object.");
  1161   1165   
  1162   1166   		return;
  1163   1167   	}
  1164   1168   
  1165         -	appfs_call_libtcl(tcl_ret = Tcl_EvalObjEx(interp, scriptObj, TCL_EVAL_DIRECT);)
         1169  +	appfs_call_libtcl(
         1170  +		tcl_ret = Tcl_EvalObjEx(interp, scriptObj, TCL_EVAL_DIRECT);
         1171  +		Tcl_DecrRefCount(scriptObj);
         1172  +	)
         1173  +
  1166   1174   	if (tcl_ret != TCL_OK) {
  1167   1175   		appfs_call_libtcl(
  1168   1176   			APPFS_DEBUG("Script returned error %i: %s", tcl_ret, Tcl_GetStringResult(interp));
  1169   1177   		)
  1170   1178   	}
  1171   1179   
  1172   1180   	return;