summaryrefslogtreecommitdiff
path: root/src/common/ers.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-03-16 13:49:06 -0300
committershennetsind <ind@henn.et>2014-03-16 13:49:06 -0300
commit2656f7f4026708f210c6ce7c39f5fc6831597982 (patch)
tree1dd5ee1a8152982b32ae8db4a6a2b01310f2d9c0 /src/common/ers.h
parent8c6547a5c3ec4d6b1845b60d14b0aae5c827892c (diff)
downloadhercules-2656f7f4026708f210c6ce7c39f5fc6831597982.tar.gz
hercules-2656f7f4026708f210c6ce7c39f5fc6831597982.tar.bz2
hercules-2656f7f4026708f210c6ce7c39f5fc6831597982.tar.xz
hercules-2656f7f4026708f210c6ce7c39f5fc6831597982.zip
Improved ERS memory handling
On shutdown the ERS will loop thru leftover managers and clear them according to each manager's settings, while also printing errors according to each manager's settings. Will also help pinpoint the causes of http://hercules.ws/board/tracker/issue-8093-memory-leak-after-stop-server-cant-fix/ and similar issues. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/ers.h')
-rw-r--r--src/common/ers.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/common/ers.h b/src/common/ers.h
index 4dae19f3b..23a996923 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -49,7 +49,7 @@
* ERS - Entry manager. *
* ers_new - Allocate an instance of an entry manager. *
* ers_report - Print a report about the current state. *
- * ers_force_destroy_all - Force the destruction of all the managers. *
+ * ers_final - Clears the remainder of the manangers. *
\*****************************************************************************/
/**
@@ -138,7 +138,7 @@ typedef struct eri {
// Disable the public functions
# define ers_new(size,name,options) NULL
# define ers_report()
-# define ers_force_destroy_all()
+# define ers_final()
#else /* not DISABLE_ERS */
// These defines should be used to allow the code to keep working whenever
// the system is disabled
@@ -170,14 +170,9 @@ ERS ers_new(uint32 size, char *name, enum ERSOptions options);
void ers_report(void);
/**
- * Forcibly destroy all the entry managers, checking for nothing.
- * The system is left as if no instances or entries had ever been allocated.
- * All previous entries and instances of the managers become invalid.
- * The use of this is NOT recommended.
- * It should only be used in extreme situations to make shure all the memory
- * allocated by this system is released.
- */
-void ers_force_destroy_all(void);
+ * Clears the remainder of the manangers
+ **/
+void ers_final(void);
#endif /* DISABLE_ERS / not DISABLE_ERS */
#endif /* _COMMON_ERS_H_ */