diff --git a/README.md b/README.md index 49970e4..f7f911d 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,7 @@ The following organization has been set up for the development: - Module developers should note in the `README.txt` file whether the module has requirements or known incompatibilities with other modules. + +- If your module project contains several erlang modules, you should export a + function pre_uninstall/0 in the main one listing the other ones. + See mod_statsdx as an example. diff --git a/mod_statsdx/src/mod_statsdx.erl b/mod_statsdx/src/mod_statsdx.erl index 6b518c4..3174609 100644 --- a/mod_statsdx/src/mod_statsdx.erl +++ b/mod_statsdx/src/mod_statsdx.erl @@ -15,6 +15,7 @@ -export([start/2, stop/1, depends/2, mod_opt_type/1, mod_options/1]). -export([loop/1, get_statistic/2, + pre_uninstall/0, received_response/3, %% Commands getstatsdx/1, getstatsdx/2, @@ -79,6 +80,10 @@ stop(Host) -> _ -> ?PROCNAME ! {stop, Host} end. +pre_uninstall() -> + [{code:purge(M), code:delete(M)} + || M <- [mod_stats2file]]. + depends(_Host, _Opts) -> [].