ZSList::SendWhoAll, wold server related crash bug FIX
Ok, after a little debugging, I think I got a fix.
The bug seems to be a linux only problem cased by people doing alot of /who all commands. Ok, the file is world/zoneserver.cpp function is: ZSList::SendWhoAll ok here is the fix: scroll down till you see this: Code:
int32 unknown52=totalusers;char *buffer=(char*)malloc(pack2->size); make it read: Code:
int32 unknown52=totalusers;Code:
safe_delete(pack2);should like like this: Code:
safe_delete(pack2);This fix should work under windows as well, though at this point in time that has not been tested. |
that wont work under any true c++ compiler because arrays such as that must be declared with a constant size. VS .NET will not allow it.
Example: Quote:
Code:
c:\test\blah.cpp(8): error C2057: expected constant expression |
Updated Fix
Ok, you may be right, but I found a way that works.
insited of using: Code:
char *buffer=(char*)malloc(pack2->size);Code:
uchar *buffer = new uchar[pack2->size];then under that line change: Code:
char *bufptr=buffer;Code:
uchar *bufptr=buffer;Code:
free(buffer);Code:
safe_delete(buffer); |
yup that works fine
|
safe_delete_array()?
|
yea, buffer is an array, not a single object, so it needs to be delete [] or safe_delete_array.
Safe delete is our choice, we went back a couple of months ago and tried to convert all deletes to safe deletes.. That and other changes are available in CVS today. Also, kath corrected a potenial crash bug in world server as well. |
| All times are GMT -4. The time now is 01:37 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.