diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-22 10:48:57 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-22 10:48:57 +0000 |
commit | 7dc7a1fc2071ca796ca1cbb091a6b97d412a41f1 (patch) | |
tree | e1af85d9e084d7e96f2d7dbc032d6a846f7a5151 /src/char | |
parent | 220eb19293c057036c162da9bd0b7a7cd4e0a986 (diff) | |
download | hercules-7dc7a1fc2071ca796ca1cbb091a6b97d412a41f1.tar.gz hercules-7dc7a1fc2071ca796ca1cbb091a6b97d412a41f1.tar.bz2 hercules-7dc7a1fc2071ca796ca1cbb091a6b97d412a41f1.tar.xz hercules-7dc7a1fc2071ca796ca1cbb091a6b97d412a41f1.zip |
* Fixed a crash when shutting down char-server (TXT only), after it failed to load storage save data (since r1275).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14483 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/int_storage.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 09e2f123d..bae72fcf4 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -23,8 +23,8 @@ char storage_txt[1024]="save/storage.txt"; char guild_storage_txt[1024]="save/g_storage.txt"; -static DBMap* storage_db; // int account_id -> struct storage_data* -static DBMap* guild_storage_db; // int guild_id -> struct guild_storage* +static DBMap* storage_db = NULL; // int account_id -> struct storage_data* +static DBMap* guild_storage_db = NULL; // int guild_id -> struct guild_storage* // 倉庫データを文字列に変換 bool storage_tostr(char* str, int account_id, struct storage_data* p) @@ -280,8 +280,14 @@ int inter_storage_init() } void inter_storage_final() { - storage_db->destroy(storage_db, NULL); - guild_storage_db->destroy(guild_storage_db, NULL); + if(storage_db) + { + storage_db->destroy(storage_db, NULL); + } + if(guild_storage_db) + { + guild_storage_db->destroy(guild_storage_db, NULL); + } return; } |