fix some mem errors

master
bqv 2 years ago
parent 3d49f1a685
commit a4b8b9d839
No known key found for this signature in database
GPG Key ID: 9E2FF3BDEBDFC910

@ -299,16 +299,6 @@ weechat::account::~account()
*/
if (buffer)
weechat_buffer_close(buffer);
accounts.erase(name);
/* close xmpp context */
if (connection)
xmpp_conn_release(connection);
if (context)
xmpp_ctx_free(context);
delete this;
}
void weechat::account::disconnect(int reconnect)

@ -510,8 +510,7 @@ weechat::channel::member *weechat::channel::add_member(const char *id, const cha
user = user::search(&account, id);
if (user && weechat_strcasecmp(user->id, id) == 0
&& type == weechat::channel::chat_type::MUC)
if (this->id == id && type == weechat::channel::chat_type::MUC)
{
weechat_printf_date_tags(buffer, 0, "log2", "%sMUC: %s",
weechat_prefix("network"), id);

@ -72,8 +72,8 @@ bool account_read_cb(weechat::config_section& section,
if (!account->reloading_from_config)
{
bool ac_global = std::stoul(std::unique_ptr<char>(
weechat_info_get("auto_connect", NULL)).get());
bool ac_global = std::stoul(std::unique_ptr<char, decltype(free)*>(
weechat_info_get("auto_connect", NULL), &free).get());
bool ac_local = account->autoconnect();
if (ac_local && ac_global)
account->connect();

@ -172,7 +172,7 @@ namespace weechat
std::unordered_map<struct t_config_option *, config_option&> options;
};
struct config_option_free { void operator() (struct t_config_option *ptr) { weechat_config_option_free(ptr); } };
struct config_option_free { void operator() (struct t_config_option *ptr) { /* weechat_config_option_free(ptr); */ } };
struct config_option : public std::unique_ptr<struct t_config_option, config_option_free>, public config_breadcrumb {
config_option(struct t_config_option *ptr, config_section& section, std::string name)
: std::unique_ptr<struct t_config_option, config_option_free>(ptr)

Loading…
Cancel
Save