0

My code works, but the following warning appears:

swig/python detected a memory leak of type 'time_t *', no destructor found

How can I calm it down ?

Sophie Sperner
  • 4,428
  • 8
  • 35
  • 55

2 Answers2

2

Just add typedef long time_t; to your SWIG interface file.

Once SWIG knows that time_t is a native type, it will not be treated as an object that requires memory management.

ets
  • 71
  • 1
  • 4
0

I got this error whenever I accessed a struct member containing a type that wasn't SWIG wrapped. Not sure if this is your problem (posting your code would help :P), but if so then you could either define your custom time_t in the interface file (just put the C definition in the interface file), or tell SWIG to wrap the (presumably) system header file containing the definition of time_t.

Mike T
  • 86
  • 5