Fix for CONPY-108 (memory leak):

- initialize datetime API only once per object file
- don't reparse same statement
This commit is contained in:
Georg Richter
2020-08-29 12:20:52 +02:00
parent 3c264b2d2a
commit bd560c2bb9
4 changed files with 109 additions and 105 deletions

View File

@ -17,6 +17,7 @@
51 Franklin St., Fifth Floor, Boston, MA 02110, USA
******************************************************************************/
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "bytesobject.h"
#include "structmember.h"
@ -29,7 +30,6 @@
#include <time.h>
#include <docs/common.h>
#if defined(_WIN32)
#include <windows.h>
typedef CRITICAL_SECTION pthread_mutex_t;
@ -62,6 +62,8 @@ int clock_gettime(int dummy, struct timespec *ct);
#define CLOCK_MONOTONIC_RAW 1
#endif
int codecs_datetime_init();
#define REQUIRED_CC_VERSION 30103