]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict: Unref dict connection immediately when connection is destroyed
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Jul 2019 09:05:37 +0000 (12:05 +0300)
committerSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Wed, 29 Sep 2021 08:46:27 +0000 (09:46 +0100)
The delayed unrefing is needed when calling from dict command callbacks to
avoid calling dict_deinit() too early. But the connection's destroy() vfunc
can't be called directly from dict command callbacks, so there's no need
to add further delays. Especially when this happens at deinit where there is
no possibility of calling the delayed callback anymore.

src/dict/dict-connection.c

index b23272532e55afb078511e2a450952fc183478f3..6a87c27146ef13117139fdc02877407f2643d7fa 100644 (file)
@@ -240,7 +240,7 @@ static void dict_connection_destroy(struct connection *_conn)
        dict_connection_cmds_output_more(conn);
 
        io_remove(&conn->conn.io);
-       dict_connection_unref_safe(conn);
+       dict_connection_unref(conn);
 }
 
 unsigned int dict_connections_current_count(void)