summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-20 11:48:51 -0300
committershennetsind <ind@henn.et>2014-02-20 11:48:51 -0300
commita7d421274b308f7d9cc4ac39935beae851b29b97 (patch)
treebb914b439491cba1c6e0958a76699a91a9b1dfdb /src/map/chrif.c
parentd0b9510cf0d7a47e53aa341462a1175326dfc09d (diff)
downloadhercules-a7d421274b308f7d9cc4ac39935beae851b29b97.tar.gz
hercules-a7d421274b308f7d9cc4ac39935beae851b29b97.tar.bz2
hercules-a7d421274b308f7d9cc4ac39935beae851b29b97.tar.xz
hercules-a7d421274b308f7d9cc4ac39935beae851b29b97.zip
Fixed Bug 8037
Player's var db was being cleared on unit free rather than on auth db clear, which'd cause map server to crash when trying to save already-disconnected (aka char logged out when char server was down) data. Special Thanks to FeNixZ. http://hercules.ws/board/tracker/issue-8037-map-crash-every-6-12/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index d6f0e5ef8..a09284830 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -126,8 +126,16 @@ bool chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
if ( session[fd] && session[fd]->session_data == node->sd )
session[fd]->session_data = NULL;
- if ( node->sd )
+ if ( node->sd ) {
+
+ if( node->sd->var_db )
+ node->sd->var_db->destroy(node->sd->var_db,script->reg_destroy);
+
+ if( node->sd->array_db )
+ node->sd->array_db->destroy(node->sd->array_db,script->array_free_db);
+
aFree(node->sd);
+ }
ers_free(chrif->auth_db_ers, node);
idb_remove(chrif->auth_db,account_id);