* src/odbc/ejabberd_odbc.erl: close MySQL connections on terminate (needs mysql r829)

SVN Revision: 1700
This commit is contained in:
Jérôme Sautret 2008-12-03 10:58:19 +00:00
parent bc9ba75c2b
commit 9e679aa621
1 changed files with 9 additions and 1 deletions

View File

@ -223,7 +223,15 @@ handle_info(_Info, State) ->
%% Purpose: Shutdown the server
%% Returns: any (ignored by gen_server)
%%----------------------------------------------------------------------
terminate(_Reason, _State) ->
terminate(_Reason, State) ->
case State#state.db_type of
mysql ->
% old versions of mysql driver don't have the stop function
% so the catch
catch mysql_conn:stop(State#state.db_ref);
_ ->
ok
end,
ok.
%%%----------------------------------------------------------------------