Exemple #1
0
EXPORT int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    js_quiet = 1;
    plugin_script_end (plugin, &js_data);
    if (js_script_eval)
    {
        weechat_js_unload (js_script_eval);
        js_script_eval = NULL;
    }
    js_quiet = 0;

    /* free some data */
    if (js_action_install_list)
        free (js_action_install_list);
    if (js_action_remove_list)
        free (js_action_remove_list);
    if (js_action_autoload_list)
        free (js_action_autoload_list);
    /* weechat_string_dyn_free (js_buffer_output, 1); */
    if (js_eval_output)
        free (js_eval_output);

    return WEECHAT_RC_OK;
}
Exemple #2
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    ruby_quiet = 1;
    plugin_script_end (plugin, &ruby_scripts, &weechat_ruby_unload_all);
    ruby_quiet = 0;

    /*
     * Do not cleanup ruby because this causes a crash when plugin is reloaded
     * again. This causes a memory leak, but I don't know better solution to
     * this problem :(
     */
    /*ruby_cleanup (0);*/

    /* free some data */
    if (ruby_action_install_list)
        free (ruby_action_install_list);
    if (ruby_action_remove_list)
        free (ruby_action_remove_list);
    if (ruby_action_autoload_list)
        free (ruby_action_autoload_list);

    return WEECHAT_RC_OK;
}
Exemple #3
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    tcl_quiet = 1;
    plugin_script_end (plugin, &tcl_data);
    if (tcl_script_eval)
    {
        weechat_tcl_unload (tcl_script_eval);
        tcl_script_eval = NULL;
    }
    tcl_quiet = 0;

    /* free some data */
    if (tcl_action_install_list)
        free (tcl_action_install_list);
    if (tcl_action_remove_list)
        free (tcl_action_remove_list);
    if (tcl_action_autoload_list)
        free (tcl_action_autoload_list);
    /* weechat_string_dyn_free (tcl_buffer_output, 1); */
    if (tcl_eval_output)
        free (tcl_eval_output);

    return WEECHAT_RC_OK;
}
Exemple #4
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    lua_quiet = 1;
    plugin_script_end (plugin, &lua_scripts, &weechat_lua_unload_all);
    lua_quiet = 0;

    return WEECHAT_RC_OK;
}
Exemple #5
0
EXPORT int
dogechat_plugin_end (struct t_dogechat_plugin *plugin)
{
    js_quiet = 1;
    plugin_script_end (plugin, &js_scripts, &dogechat_js_unload_all);
    js_quiet = 0;

    /* free some data */
    if (js_action_install_list)
        free (js_action_install_list);
    if (js_action_remove_list)
        free (js_action_remove_list);
    if (js_action_autoload_list)
        free (js_action_autoload_list);

    return DOGECHAT_RC_OK;
}
Exemple #6
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    lua_quiet = 1;
    plugin_script_end (plugin, &lua_scripts, &weechat_lua_unload_all);
    lua_quiet = 0;

    /* free some data */
    if (lua_action_install_list)
        free (lua_action_install_list);
    if (lua_action_remove_list)
        free (lua_action_remove_list);
    if (lua_action_autoload_list)
        free (lua_action_autoload_list);

    return WEECHAT_RC_OK;
}
Exemple #7
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    perl_quiet = 1;
    if (perl_script_eval)
    {
        weechat_perl_unload (perl_script_eval);
        perl_script_eval = NULL;
    }
    plugin_script_end (plugin, &perl_data);
    perl_quiet = 0;

#ifndef MULTIPLICITY
    /* free perl interpreter */
    if (perl_main)
    {
        perl_destruct (perl_main);
        perl_free (perl_main);
        perl_main = NULL;
    }
#endif /* MULTIPLICITY */

#if defined(PERL_SYS_TERM) && !defined(__FreeBSD__) && !defined(WIN32) && !defined(__CYGWIN__) && !(defined(__APPLE__) && defined(__MACH__))
    /*
     * we call this function on all OS, but NOT on FreeBSD or Cygwin,
     * because it crashes with no reason (bug in Perl?)
     */
    if (perl_quit_or_upgrade)
        PERL_SYS_TERM ();
#endif

    /* free some data */
    if (perl_action_install_list)
        free (perl_action_install_list);
    if (perl_action_remove_list)
        free (perl_action_remove_list);
    if (perl_action_autoload_list)
        free (perl_action_autoload_list);
    weechat_string_dyn_free (perl_buffer_output, 1);

    return WEECHAT_RC_OK;
}
Exemple #8
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    ruby_quiet = 1;
    plugin_script_end (plugin, &ruby_scripts, &weechat_ruby_unload_all);
    ruby_quiet = 0;

    ruby_cleanup (0);

    /* free some data */
    if (ruby_action_install_list)
        free (ruby_action_install_list);
    if (ruby_action_remove_list)
        free (ruby_action_remove_list);
    if (ruby_action_autoload_list)
        free (ruby_action_autoload_list);

    return WEECHAT_RC_OK;
}
Exemple #9
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    guile_quiet = 1;
    plugin_script_end (plugin, &guile_scripts, &weechat_guile_unload_all);
    guile_quiet = 0;

    /* unprotect module */
    weechat_guile_catch (scm_gc_unprotect_object, (void *)guile_module_weechat);

    /* free some data */
    if (guile_action_install_list)
        free (guile_action_install_list);
    if (guile_action_remove_list)
        free (guile_action_remove_list);
    if (guile_action_autoload_list)
        free (guile_action_autoload_list);

    return WEECHAT_RC_OK;
}
Exemple #10
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    python_quiet = 1;
    plugin_script_end (plugin, &python_scripts, &weechat_python_unload_all);
    python_quiet = 0;

    /* free python interpreter */
    if (python_mainThreadState != NULL)
    {
        /* PyEval_AcquireLock (); */
        PyThreadState_Swap (python_mainThreadState);
        /* PyEval_ReleaseLock (); */
        python_mainThreadState = NULL;
    }

    Py_Finalize ();
    if (Py_IsInitialized () != 0)
    {
        weechat_printf (NULL,
                        weechat_gettext ("%s%s: unable to free interpreter"),
                        weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
    }

    /* free some data */
    if (python2_bin)
        free (python2_bin);
    if (python_action_install_list)
        free (python_action_install_list);
    if (python_action_remove_list)
        free (python_action_remove_list);
    if (python_action_autoload_list)
        free (python_action_autoload_list);

    return WEECHAT_RC_OK;
}