16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 11:29:18 +02:00

basic patches for most of discovered memory leaks, fixes for brake system components

This commit is contained in:
tmj-fstate
2017-01-18 07:56:51 +01:00
parent 4da7fedfe1
commit 6ab550831d
33 changed files with 824 additions and 929 deletions

22
PyInt.h
View File

@@ -30,22 +30,26 @@ class TPythonInterpreter
{
protected:
TPythonInterpreter();
~TPythonInterpreter()
{
}
~TPythonInterpreter() {}
static TPythonInterpreter *_instance;
int _screenRendererPriority;
std::set<const char *, ltstr> _classes;
PyObject *_main;
// std::set<const char *, ltstr> _classes;
std::set<std::string const> _classes;
PyObject *_main;
PyObject *_stdErr;
FILE *_getFile(const char *lookupPath, const char *className);
// FILE *_getFile(const char *lookupPath, const char *className);
FILE *_getFile( std::string const &lookupPath, std::string const &className );
public:
static TPythonInterpreter *getInstance();
bool loadClassFile(const char *lookupPath, const char *className);
static void killInstance();
/* bool loadClassFile(const char *lookupPath, const char *className);
PyObject *newClass(const char *className);
PyObject *newClass(const char *className, PyObject *argsTuple);
int getScreenRendererPriotity()
*/ bool loadClassFile( std::string const &lookupPath, std::string const &className );
PyObject *newClass( std::string const &className );
PyObject *newClass( std::string const &className, PyObject *argsTuple );
int getScreenRendererPriotity()
{
return _screenRendererPriority;
};
@@ -79,7 +83,7 @@ class TPythonScreens
void *_thread;
unsigned int _threadId;
std::vector<TPythonScreenRenderer *> _screens;
char *_lookupPath;
std::string _lookupPath;
void *_train;
void _cleanup();
void _freeTrainState();