Diff

Differences From Artifact [99975a5e76]:

To Artifact [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;