Hello Denis, Thursday, February 15, 2007, 2:23:07 PM, I wrote: AM>> There is a patch to Cyrus SASL that can do proper reference counting. DM> Could you say me where I can get it ? Google knows nothing about it... I've written my own patch which adds different functions for server and client termination: sasl_server_done() & sasl_client_done(). This patch is compatible with all existing applications, so you can include it to the SASL library. In 'sasl.h': /*** DEN 02/15/2007 ***** begin **********************************************/ /* dispose of SASL server. Connection * states have to be disposed of before calling this. */ LIBSASL_API void sasl_server_done(void); /* dispose of SASL client. Connection * states have to be disposed of before calling this. */ LIBSASL_API void sasl_client_done(void); /*** DEN 02/15/2007 ***** end ************************************************/ In 'common.c': /*** DEN 02/15/2007 ***** begin **********************************************/ void sasl_server_done(void) { if (_sasl_server_cleanup_hook && _sasl_server_cleanup_hook() == SASL_OK) { _sasl_server_idle_hook = NULL; _sasl_server_cleanup_hook = NULL; } if(_sasl_server_cleanup_hook || _sasl_client_cleanup_hook) return; sasl_done(); } void sasl_client_done(void) { if (_sasl_client_cleanup_hook && _sasl_client_cleanup_hook() == SASL_OK) { _sasl_client_idle_hook = NULL; _sasl_client_cleanup_hook = NULL; } if(_sasl_server_cleanup_hook || _sasl_client_cleanup_hook) return; sasl_done(); } /*** DEN 02/15/2007 ***** end ************************************************/ -- Best regards, Denis Malyshkin, C++ Developer of ISS Art, Ltd., Omsk, Russia. http://issart.com http://issart.com/index/Portfolio/cpp&lang=eng mailto:dmalyshkin@xxxxxxxxx