From: <dg...@su...> - 2009-01-19 21:25:24
|
Author: savago Date: Mon Jan 19 22:24:24 2009 New Revision: 5201 URL: http://www.opensync.org/changeset/5201 Log: Renaming initialize function and adding code to cleanup the XSLT context in finalize. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:20:49 2009 (r5200) +++ format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:24:24 2009 (r5201) @@ -175,7 +175,7 @@ return TRUE; } -void *initialize(const char* config, OSyncError **error) +void *init_xslt_to_contact(const char* config, OSyncError **error) { struct xslt_resources *converter = xslt_new(); int result = 0; @@ -190,15 +190,15 @@ } -void finalize(void *userdata) +void fin_xslt_to_contact(void *userdata) { - /* - * Here you can free all your converter specific data. - */ -/* format_data *formatdata =(format_data*)userdata; - g_free(formatdata->data); - g_free(formatdata); -*/ + struct xslt_resources *converter = NULL; + if (!userdata) + return; + + converter = (struct xslt_resources *)userdata; + xslt_delete(converter); + } osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) @@ -223,8 +223,8 @@ conv_xslt_to_contact, error); if (!conv) return FALSE; - osync_converter_set_initialize_func(conv, initialize); - osync_converter_set_finalize_func(conv, finalize); + osync_converter_set_initialize_func(conv, init_xslt_to_contact); + osync_converter_set_finalize_func(conv, fin_xslt_to_contact); osync_format_env_register_converter(env, conv); osync_converter_unref(conv); |