plugin_end() & SQL_FreeHandle = WRONG
If you use plugin_end() with SQL_* then you will get random crash on map change. (Linux 100% , possible in win too)
Some docs: Quote:
So, then there is a question, where to put SQL_FreeHandle ? When plugin starts, it's connecting to mysql and connection is alive until map change, then you need some how close mysql connection or you will got memory leak, so how to do it ? Thanks. |
Re: plugin_end() & SQL_FreeHandle = WRONG
You could connect/disconnect each time you need to do a query.
|
Re: plugin_end() & SQL_FreeHandle = WRONG
i think this will be a bit slow if i have many sql querys in my script.
Need some how handle changelevel , and disconnect from mysql there, and after that server will change level.. but before plugin_end is called. |
Re: plugin_end() & SQL_FreeHandle = WRONG
Then rearrange your logic.
|
Re: plugin_end() & SQL_FreeHandle = WRONG
Then use threaded queries instead of normal queries.
|
Re: plugin_end() & SQL_FreeHandle = WRONG
You need sql connection if you want to use SQL_QuoteString.
@waza123a: I'm using SQL_FreeHandle in plugin_end in my rpg mod (when you save player data by name) and it has never caused crash when I was testing it. See if you can crash your server with it. If you can't make it crash your server, then take a look at the way I coded it and maybe you will find a way to solve your problem. |
Re: plugin_end() & SQL_FreeHandle = WRONG
@up - but server leaves opened mysql connections.
|
| All times are GMT -4. The time now is 08:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.