Remove DohClose (Close) and replace with calls to DohDelete (Delete) to fix some minor memory leaks in most uses of NewFile.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13885 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
61b4c1cbcd
commit
5a1e82a2f4
25 changed files with 45 additions and 91 deletions
|
|
@ -761,6 +761,7 @@ int DohUngetc(int ch, DOH *obj) {
|
|||
* DohClose()
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
int DohClose(DOH *obj) {
|
||||
DohBase *b = (DohBase *) obj;
|
||||
DohObjInfo *objinfo;
|
||||
|
|
@ -773,6 +774,7 @@ int DohClose(DOH *obj) {
|
|||
}
|
||||
return fclose((FILE *) obj);
|
||||
}
|
||||
*/
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* DohIsString()
|
||||
|
|
|
|||
|
|
@ -307,7 +307,10 @@ extern DOHFile *DohNewFile(DOH *filename, const char *mode, DOHList *outfiles);
|
|||
extern DOHFile *DohNewFileFromFile(FILE *f);
|
||||
extern DOHFile *DohNewFileFromFd(int fd);
|
||||
extern void DohFileErrorDisplay(DOHString * filename);
|
||||
/*
|
||||
Deprecated, just use DohDelete
|
||||
extern int DohClose(DOH *file);
|
||||
*/
|
||||
extern int DohCopyto(DOHFile * input, DOHFile * output);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1654,7 +1654,6 @@ int ALLEGROCL::top(Node *n) {
|
|||
if (Generate_Wrapper) {
|
||||
f_begin = NewFile(cxx_filename, "w", SWIG_output_files());
|
||||
if (!f_begin) {
|
||||
Close(f_cl);
|
||||
Delete(f_cl);
|
||||
Printf(stderr, "Unable to open %s for writing\n", cxx_filename);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
|
|
@ -1711,15 +1710,13 @@ int ALLEGROCL::top(Node *n) {
|
|||
Printf(f_cl, "%s\n", f_clhead);
|
||||
Printf(f_cl, "%s\n", f_clwrap);
|
||||
|
||||
Close(f_cl);
|
||||
Delete(f_cl); // Delete the handle, not the file
|
||||
Delete(f_cl);
|
||||
Delete(f_clhead);
|
||||
Delete(f_clwrap);
|
||||
|
||||
Dump(f_runtime, f_begin);
|
||||
Printf(f_begin, "%s\n", f_cxx_wrapper);
|
||||
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
Delete(f_cxx_wrapper);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ int CFFI::top(Node *n) {
|
|||
if (CPlusPlus || CWrap) {
|
||||
f_begin = NewFile(cxx_filename, "w", SWIG_output_files());
|
||||
if (!f_begin) {
|
||||
Close(f_lisp);
|
||||
Delete(f_lisp);
|
||||
Printf(stderr, "Unable to open %s for writing\n", cxx_filename);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
|
|
@ -147,7 +146,6 @@ int CFFI::top(Node *n) {
|
|||
Printf(clos_filename, "%s%s-clos.lisp", SWIG_output_directory(), module);
|
||||
f_clos = NewFile(clos_filename, "w", SWIG_output_files());
|
||||
if (!f_clos) {
|
||||
Close(f_lisp);
|
||||
Delete(f_lisp);
|
||||
Printf(stderr, "Unable to open %s for writing\n", cxx_filename);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
|
|
@ -184,13 +182,11 @@ int CFFI::top(Node *n) {
|
|||
Printf(f_lisp, "%s\n", f_cl);
|
||||
Printf(f_lisp, "%s\n", f_clwrap);
|
||||
|
||||
Close(f_lisp);
|
||||
Delete(f_lisp); // Deletes the handle, not the file
|
||||
Delete(f_lisp);
|
||||
Delete(f_cl);
|
||||
Delete(f_clhead);
|
||||
Delete(f_clwrap);
|
||||
Dump(f_runtime, f_begin);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
Delete(f_cxx_wrapper);
|
||||
|
|
|
|||
|
|
@ -290,8 +290,6 @@ int CHICKEN::top(Node *n) {
|
|||
|
||||
Printf(f_scm, "%s\n", chickentext);
|
||||
|
||||
|
||||
Close(f_scm);
|
||||
Delete(f_scm);
|
||||
|
||||
char buftmp[20];
|
||||
|
|
@ -324,7 +322,6 @@ int CHICKEN::top(Node *n) {
|
|||
Delete(f_wrappers);
|
||||
Delete(f_sym_size);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -141,8 +141,7 @@ int CLISP::top(Node *n) {
|
|||
Seek(f_cl, 0, SEEK_SET);
|
||||
Write(f_cl, Char(header), Len(header));
|
||||
|
||||
Close(f_cl);
|
||||
Delete(f_cl); // Deletes the handle, not the file
|
||||
Delete(f_cl);
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ public:
|
|||
Printf(f_im, "}\n");
|
||||
addCloseNamespace(0, f_im);
|
||||
|
||||
Close(f_im);
|
||||
Delete(f_im);
|
||||
}
|
||||
|
||||
// Generate the C# module class
|
||||
|
|
@ -519,7 +519,7 @@ public:
|
|||
Printf(f_module, "}\n");
|
||||
addCloseNamespace(0, f_module);
|
||||
|
||||
Close(f_module);
|
||||
Delete(f_module);
|
||||
}
|
||||
|
||||
if (upcasts_code)
|
||||
|
|
@ -610,7 +610,6 @@ public:
|
|||
Printf(f_runtime_h, "\n");
|
||||
Printf(f_runtime_h, "#endif\n");
|
||||
|
||||
Close(f_runtime_h);
|
||||
Delete(f_runtime_h);
|
||||
f_runtime_h = NULL;
|
||||
Delete(f_directors);
|
||||
|
|
@ -624,7 +623,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
@ -1225,7 +1223,7 @@ public:
|
|||
"\n", enum_code, "\n", NIL);
|
||||
|
||||
addCloseNamespace(nspace, f_enum);
|
||||
Close(f_enum);
|
||||
Delete(f_enum);
|
||||
Delete(output_directory);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1955,7 +1953,7 @@ public:
|
|||
|
||||
Printf(f_proxy, "}\n");
|
||||
addCloseNamespace(nspace, f_proxy);
|
||||
Close(f_proxy);
|
||||
Delete(f_proxy);
|
||||
f_proxy = NULL;
|
||||
|
||||
/* Output the downcast method, if necessary. Note: There's no other really
|
||||
|
|
@ -3227,7 +3225,7 @@ public:
|
|||
|
||||
addCloseNamespace(0, f_swigtype);
|
||||
|
||||
Close(f_swigtype);
|
||||
Delete(f_swigtype);
|
||||
Delete(swigtype);
|
||||
Delete(n);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ public:
|
|||
replaceModuleVariables(im_dmodule_code);
|
||||
Printv(im_d_file, im_dmodule_code, NIL);
|
||||
|
||||
Close(im_d_file);
|
||||
Delete(im_d_file);
|
||||
}
|
||||
|
||||
// Generate the main D proxy module.
|
||||
|
|
@ -571,7 +571,7 @@ public:
|
|||
replaceModuleVariables(proxy_dmodule_code);
|
||||
Printv(proxy_d_file, proxy_dmodule_code, NIL);
|
||||
|
||||
Close(proxy_d_file);
|
||||
Delete(proxy_d_file);
|
||||
}
|
||||
|
||||
// Generate the additional proxy modules for nspace support.
|
||||
|
|
@ -598,7 +598,7 @@ public:
|
|||
replaceModuleVariables(code);
|
||||
Printv(file, code, NIL);
|
||||
|
||||
Close(file);
|
||||
Delete(file);
|
||||
Delete(module_name);
|
||||
}
|
||||
|
||||
|
|
@ -693,7 +693,6 @@ public:
|
|||
Printf(f_runtime_h, "\n");
|
||||
Printf(f_runtime_h, "#endif\n");
|
||||
|
||||
Close(f_runtime_h);
|
||||
Delete(f_runtime_h);
|
||||
f_runtime_h = NULL;
|
||||
Delete(f_directors);
|
||||
|
|
@ -707,7 +706,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
@ -868,7 +866,6 @@ public:
|
|||
|
||||
Printv(class_file, proxy_enum_code, NIL);
|
||||
|
||||
Close(class_file);
|
||||
Delete(class_file);
|
||||
} else {
|
||||
String *nspace = Getattr(n, "sym:nspace");
|
||||
|
|
@ -1363,7 +1360,6 @@ public:
|
|||
replaceModuleVariables(proxy_class_code);
|
||||
Printv(class_file, proxy_class_code, NIL);
|
||||
|
||||
Close(class_file);
|
||||
Delete(class_file);
|
||||
} else {
|
||||
Printv(proxyImportsBuffer(getNSpace()), proxy_class_imports, NIL);
|
||||
|
|
@ -3469,7 +3465,6 @@ private:
|
|||
Printv(class_file, code_target, NIL);
|
||||
Delete(code_target);
|
||||
|
||||
Close(class_file);
|
||||
Delete(class_file);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -437,12 +437,10 @@ private:
|
|||
|
||||
if (directorsEnabled()) {
|
||||
Printf(f_c_directors_h, "#endif\n");
|
||||
Close(f_c_directors_h);
|
||||
Delete(f_c_directors_h);
|
||||
f_c_directors_h = NULL;
|
||||
|
||||
Dump(f_c_directors, f_c_runtime);
|
||||
Close(f_c_directors);
|
||||
Delete(f_c_directors);
|
||||
f_c_directors = NULL;
|
||||
}
|
||||
|
|
@ -475,12 +473,9 @@ private:
|
|||
Delete(f_gc_wrappers);
|
||||
}
|
||||
|
||||
Close(f_c_begin);
|
||||
Delete(f_c_begin);
|
||||
Close(f_go_begin);
|
||||
Delete(f_go_begin);
|
||||
if (!gccgo_flag) {
|
||||
Close(f_gc_begin);
|
||||
Delete(f_gc_begin);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -409,7 +409,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ public:
|
|||
}
|
||||
// Finish off the class
|
||||
Printf(f_im, "}\n");
|
||||
Close(f_im);
|
||||
Delete(f_im);
|
||||
}
|
||||
|
||||
// Generate the Java module class
|
||||
|
|
@ -554,7 +554,7 @@ public:
|
|||
|
||||
// Finish off the class
|
||||
Printf(f_module, "}\n");
|
||||
Close(f_module);
|
||||
Delete(f_module);
|
||||
}
|
||||
|
||||
// Generate the Java constants interface
|
||||
|
|
@ -585,7 +585,7 @@ public:
|
|||
|
||||
// Finish off the Java interface
|
||||
Printf(f_module, "}\n");
|
||||
Close(f_module);
|
||||
Delete(f_module);
|
||||
}
|
||||
|
||||
if (upcasts_code)
|
||||
|
|
@ -685,7 +685,6 @@ public:
|
|||
Printf(f_runtime_h, "\n");
|
||||
Printf(f_runtime_h, "#endif\n");
|
||||
|
||||
Close(f_runtime_h);
|
||||
Delete(f_runtime_h);
|
||||
f_runtime_h = NULL;
|
||||
Delete(f_directors);
|
||||
|
|
@ -701,7 +700,6 @@ public:
|
|||
Delete(f_init);
|
||||
Dump(f_runtime, f_begin);
|
||||
Delete(f_runtime);
|
||||
Close(f_begin);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
@ -1300,7 +1298,7 @@ public:
|
|||
"\n", enum_code, "\n", NIL);
|
||||
|
||||
Printf(f_enum, "\n");
|
||||
Close(f_enum);
|
||||
Delete(f_enum);
|
||||
Delete(output_directory);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1977,7 +1975,7 @@ public:
|
|||
Printv(f_proxy, proxy_class_constants_code, NIL);
|
||||
|
||||
Printf(f_proxy, "}\n");
|
||||
Close(f_proxy);
|
||||
Delete(f_proxy);
|
||||
f_proxy = NULL;
|
||||
|
||||
/* Output the downcast method, if necessary. Note: There's no other really
|
||||
|
|
@ -3069,7 +3067,7 @@ public:
|
|||
Replaceall(swigtype, "$imclassname", imclass_name);
|
||||
Printv(f_swigtype, swigtype, NIL);
|
||||
|
||||
Close(f_swigtype);
|
||||
Delete(f_swigtype);
|
||||
Delete(swigtype);
|
||||
Delete(n);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -396,7 +396,6 @@ public:
|
|||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Delete(f_initbeforefunc);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
Delete(s_dot_get);
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ static void SWIG_dump_runtime() {
|
|||
s = Swig_include_sys("swiglabels.swg");
|
||||
if (!s) {
|
||||
Printf(stderr, "*** Unable to open 'swiglabels.swg'\n");
|
||||
Close(runtime);
|
||||
Delete(runtime);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
Printf(runtime, "%s", s);
|
||||
|
|
@ -412,7 +412,7 @@ static void SWIG_dump_runtime() {
|
|||
s = Swig_include_sys("swigerrors.swg");
|
||||
if (!s) {
|
||||
Printf(stderr, "*** Unable to open 'swigerrors.swg'\n");
|
||||
Close(runtime);
|
||||
Delete(runtime);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
Printf(runtime, "%s", s);
|
||||
|
|
@ -421,7 +421,7 @@ static void SWIG_dump_runtime() {
|
|||
s = Swig_include_sys("swigrun.swg");
|
||||
if (!s) {
|
||||
Printf(stderr, "*** Unable to open 'swigrun.swg'\n");
|
||||
Close(runtime);
|
||||
Delete(runtime);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
Printf(runtime, "%s", s);
|
||||
|
|
@ -434,13 +434,12 @@ static void SWIG_dump_runtime() {
|
|||
s = Swig_include_sys("runtime.swg");
|
||||
if (!s) {
|
||||
Printf(stderr, "*** Unable to open 'runtime.swg'\n");
|
||||
Close(runtime);
|
||||
Delete(runtime);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
Printf(runtime, "%s", s);
|
||||
Delete(s);
|
||||
|
||||
Close(runtime);
|
||||
Delete(runtime);
|
||||
SWIG_exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
@ -1009,7 +1008,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
if (Verbose)
|
||||
Printf(stdout, "'%s' checked out from the SWIG library.\n", outfile);
|
||||
Printv(f_outfile, s, NIL);
|
||||
Close(f_outfile);
|
||||
Delete(f_outfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1111,7 +1110,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
}
|
||||
Printf(f_dependencies_file, "\n");
|
||||
if (f_dependencies_file != stdout)
|
||||
Close(f_dependencies_file);
|
||||
Delete(f_dependencies_file);
|
||||
if (depend_only)
|
||||
SWIG_exit(EXIT_SUCCESS);
|
||||
} else {
|
||||
|
|
@ -1285,7 +1284,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
int i;
|
||||
for (i = 0; i < Len(all_output_files); i++)
|
||||
Printf(f_outfiles, "%s\n", Getitem(all_output_files, i));
|
||||
Close(f_outfiles);
|
||||
Delete(f_outfiles);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -835,7 +835,7 @@ MODULA3():
|
|||
scanConstant(file, n);
|
||||
Printf(file, " return 0;\n");
|
||||
Printf(file, "}\n");
|
||||
Close(file);
|
||||
Delete(file);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -870,7 +870,7 @@ MODULA3():
|
|||
by SWIG with option -generaterename. */\n\
|
||||
\n", input_file);
|
||||
scanRename(file, n);
|
||||
Close(file);
|
||||
Delete(file);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -900,7 +900,7 @@ MODULA3():
|
|||
by SWIG with option -generatetypemap. */\n\
|
||||
\n", input_file);
|
||||
scanTypemap(file, n);
|
||||
Close(file);
|
||||
Delete(file);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1009,7 +1009,7 @@ MODULA3():
|
|||
} else {
|
||||
Printf(file, "library(\"m3%s\")\n", name);
|
||||
}
|
||||
Close(file);
|
||||
Delete(file);
|
||||
}
|
||||
|
||||
// Generate the raw interface
|
||||
|
|
@ -1027,7 +1027,7 @@ MODULA3():
|
|||
Printv(file, m3raw_intf.f, NIL);
|
||||
|
||||
Printf(file, "\nEND %s.\n", m3raw_name);
|
||||
Close(file);
|
||||
Delete(file);
|
||||
}
|
||||
|
||||
// Generate the raw module
|
||||
|
|
@ -1045,7 +1045,7 @@ MODULA3():
|
|||
Printv(file, m3raw_impl.f, NIL);
|
||||
|
||||
Printf(file, "BEGIN\nEND %s.\n", m3raw_name);
|
||||
Close(file);
|
||||
Delete(file);
|
||||
}
|
||||
|
||||
// Generate the interface for the comfort wrappers
|
||||
|
|
@ -1075,7 +1075,7 @@ MODULA3():
|
|||
|
||||
// Finish off the class
|
||||
Printf(file, "\nEND %s.\n", m3wrap_name);
|
||||
Close(file);
|
||||
Delete(file);
|
||||
}
|
||||
|
||||
// Generate the wrapper routines implemented in Modula 3
|
||||
|
|
@ -1096,7 +1096,7 @@ MODULA3():
|
|||
Printv(file, m3wrap_impl.f, NIL);
|
||||
|
||||
Printf(file, "\nBEGIN\nEND %s.\n", m3wrap_name);
|
||||
Close(file);
|
||||
Delete(file);
|
||||
}
|
||||
|
||||
if (upcasts_code)
|
||||
|
|
@ -1162,7 +1162,6 @@ MODULA3():
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
@ -2555,7 +2554,7 @@ MODULA3():
|
|||
Printv(f_proxy, proxy_class_def, proxy_class_code, NIL);
|
||||
|
||||
Printf(f_proxy, "}\n");
|
||||
Close(f_proxy);
|
||||
Delete(f_proxy);
|
||||
f_proxy = NULL;
|
||||
|
||||
Delete(proxy_class_name);
|
||||
|
|
@ -3811,7 +3810,7 @@ MODULA3():
|
|||
Replaceall(swigtype, "$m3classname", classname);
|
||||
Printv(f_swigtype, swigtype, NIL);
|
||||
|
||||
Close(f_swigtype);
|
||||
Delete(f_swigtype);
|
||||
Delete(filen);
|
||||
Delete(swigtype);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -343,7 +343,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
@ -357,14 +356,12 @@ public:
|
|||
Dump(f_class_ctors, f_mlout);
|
||||
Dump(f_class_ctors_end, f_mlout);
|
||||
Dump(f_mltail, f_mlout);
|
||||
Close(f_mlout);
|
||||
Delete(f_mlout);
|
||||
|
||||
Dump(f_enumtypes_type, f_mliout);
|
||||
Dump(f_enumtypes_value, f_mliout);
|
||||
Dump(f_mlibody, f_mliout);
|
||||
Dump(f_mlitail, f_mliout);
|
||||
Close(f_mliout);
|
||||
Delete(f_mliout);
|
||||
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -232,7 +232,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_directors);
|
||||
Delete(f_directors_h);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
|
|||
|
|
@ -520,7 +520,6 @@ public:
|
|||
Printf(f_pm, "%s", additional_perl_code);
|
||||
|
||||
Printf(f_pm, "1;\n");
|
||||
Close(f_pm);
|
||||
Delete(f_pm);
|
||||
Delete(base);
|
||||
Delete(dest_package);
|
||||
|
|
@ -534,7 +533,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -615,7 +615,7 @@ public:
|
|||
|
||||
Printf(f_h, "#endif /* PHP_%s_H */\n", cap_module);
|
||||
|
||||
Close(f_h);
|
||||
Delete(f_h);
|
||||
|
||||
String *type_table = NewStringEmpty();
|
||||
SwigType_emit_type_table(f_runtime, type_table);
|
||||
|
|
@ -630,7 +630,7 @@ public:
|
|||
Dump(f_directors_h, f_runtime_h);
|
||||
Printf(f_runtime_h, "\n");
|
||||
Printf(f_runtime_h, "#endif\n");
|
||||
Close(f_runtime_h);
|
||||
Delete(f_runtime_h);
|
||||
}
|
||||
|
||||
Printf(s_header, "/* end header section */\n");
|
||||
|
|
@ -654,7 +654,6 @@ public:
|
|||
Delete(s_vdecl);
|
||||
Delete(all_cs_entry);
|
||||
Delete(s_entry);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
@ -667,7 +666,7 @@ public:
|
|||
s_fakeoowrappers = NULL;
|
||||
}
|
||||
Printf(f_phpcode, "%s\n?>\n", s_phpclasses);
|
||||
Close(f_phpcode);
|
||||
Delete(f_phpcode);
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,8 +182,6 @@ public:
|
|||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Delete(f_classInit);
|
||||
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
|
|||
|
|
@ -979,7 +979,6 @@ public:
|
|||
Printv(f_shadow_py, "\n", f_shadow_builtin_imports, "\n", NIL);
|
||||
Printv(f_shadow_py, f_shadow, "\n", NIL);
|
||||
Printv(f_shadow_py, f_shadow_stubs, "\n", NIL);
|
||||
Close(f_shadow_py);
|
||||
Delete(f_shadow_py);
|
||||
}
|
||||
|
||||
|
|
@ -992,7 +991,7 @@ public:
|
|||
Printf(f_runtime_h, "\n");
|
||||
Printf(f_runtime_h, "#endif\n");
|
||||
if (f_runtime_h != f_begin)
|
||||
Close(f_runtime_h);
|
||||
Delete(f_runtime_h);
|
||||
Dump(f_directors, f_begin);
|
||||
}
|
||||
|
||||
|
|
@ -1007,8 +1006,6 @@ public:
|
|||
Delete(f_init);
|
||||
Delete(f_directors);
|
||||
Delete(f_directors_h);
|
||||
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
|
|||
|
|
@ -837,7 +837,6 @@ int R::top(Node *n) {
|
|||
Delete(f_init);
|
||||
|
||||
Delete(s_header);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
@ -871,8 +870,7 @@ int R::DumpCode(Node *n) {
|
|||
Printf(scode, "%s\n\n", s_classes);
|
||||
Printf(scode, "%s\n", sfile);
|
||||
|
||||
Close(scode);
|
||||
// Delete(scode);
|
||||
Delete(scode);
|
||||
String *outfile = Getattr(n,"outfile");
|
||||
File *runtime = NewFile(outfile,"w", SWIG_output_files());
|
||||
if (!runtime) {
|
||||
|
|
@ -886,7 +884,6 @@ int R::DumpCode(Node *n) {
|
|||
Printf(runtime, "%s\n", f_wrapper);
|
||||
Printf(runtime, "%s\n", f_init);
|
||||
|
||||
Close(runtime);
|
||||
Delete(runtime);
|
||||
|
||||
if(outputNamespaceInfo) {
|
||||
|
|
@ -907,7 +904,6 @@ int R::DumpCode(Node *n) {
|
|||
Printf(ns, "\nexportMethods(\n");
|
||||
writeListByLine(namespaceFunctions, ns, 1);
|
||||
Printf(ns, ")\n");
|
||||
Close(ns);
|
||||
Delete(ns);
|
||||
Delete(s_namespace);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1185,7 +1185,7 @@ public:
|
|||
Dump(f_directors_h, f_runtime_h);
|
||||
Printf(f_runtime_h, "\n");
|
||||
Printf(f_runtime_h, "#endif\n");
|
||||
Close(f_runtime_h);
|
||||
Delete(f_runtime_h);
|
||||
}
|
||||
|
||||
Dump(f_wrappers, f_begin);
|
||||
|
|
@ -1196,7 +1196,6 @@ public:
|
|||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Delete(f_initbeforefunc);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
|
||||
|
|
|
|||
|
|
@ -248,7 +248,6 @@ public:
|
|||
|
||||
if (itcl) {
|
||||
Printv(f_shadow, f_shadow_stubs, "\n", NIL);
|
||||
Close(f_shadow);
|
||||
Delete(f_shadow);
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +258,6 @@ public:
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_runtime);
|
||||
Delete(f_begin);
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -266,9 +266,7 @@ int UFFI::top(Node *n) {
|
|||
|
||||
Language::top(n);
|
||||
|
||||
Close(f_cl);
|
||||
Delete(f_cl); // Delete the handle, not the file
|
||||
Close(f_null);
|
||||
Delete(f_null);
|
||||
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue