mirror of
https://github.com/bqv/weechat-xmpp/
synced 2024-11-04 12:00:30 +00:00
fix some mem errors
This commit is contained in:
parent
3d49f1a685
commit
a4b8b9d839
10
account.cpp
10
account.cpp
@ -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…
Reference in New Issue
Block a user