Don't register commands twice, only register them before threading begins.
[citadel.git] / citadel / policy.c
index 1c8ca4a2a32ef5fc0e1568c6588d8a85aa7066a0..acfb916442e3880bec85fbeda49178751a5b6d12 100644 (file)
@@ -185,8 +185,10 @@ void cmd_spex(char *argbuf) {
 
 CTDL_MODULE_INIT(policy)
 {
-       CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Autoconverted. TODO: document me.");
-       CtdlRegisterProtoHook(cmd_spex, "SPEX", "Autoconverted. TODO: document me.");
+       if (!threading) {
+               CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Autoconverted. TODO: document me.");
+               CtdlRegisterProtoHook(cmd_spex, "SPEX", "Autoconverted. TODO: document me.");
+       }
         /* return our Subversion id for the Log */
        return "$Id$";
 }