]> git.sesse.net Git - xml-template/blobdiff - php5-swig/xml-template.swig
Leak a little less memory in php5-swig.
[xml-template] / php5-swig / xml-template.swig
index fa9e7aa81d4bf0fbb6ee4b358c885549657025f7..2feceba72843fada4f12226cfd7acf6ff36361cf 100644 (file)
@@ -58,6 +58,8 @@ Directive* convert_php_objects_to_directive(zval *obj)
                char *str = Z_STRVAL_P(obj);
                return new Replace(str);
        }
+       case IS_NULL:
+               return NULL;
        default:
                printf("WARNING: Unknown type %d!\n", Z_TYPE_P(obj));
                break;
@@ -66,12 +68,19 @@ Directive* convert_php_objects_to_directive(zval *obj)
        return NULL;
 }
 
+xmlDocPtr XML_Template_process_file(const char *input_filename, Directive *root_directive, bool clean)
+{
+       xmlDocPtr ret = process_file(input_filename, root_directive, clean);
+       delete root_directive;
+       return ret;
+}
+
 %}
 
 %typemap(in) Directive* {
        $1 = convert_php_objects_to_directive(*$input);
 }
 
-xmlDocPtr process_file(const char *input_filename, Directive *root_directive, bool clean);
+xmlDocPtr XML_Template_process_file(const char *input_filename, Directive *root_directive, bool clean);
 void output_to_fd_and_free(xmlDocPtr doc, int fd);