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:
Native Overview
The basic natives of SQLX are:
- SQL_FreeHandle - Frees a Handle. You must do this or else memory will leak.
- Note that you should currently not call this native during plugin_end(). The backend threader freezes the query queue at this time and flushes all remaining queries back to the main thread. It is likely your plugin will simply deadlock (freeze idly). Even if this is corrected, there is no reason to use threaded queries in plugin_end() anyway, because all remaining threaded queries are executed as non-threaded before the mapchanges.
|
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.