I'm using the xprofile extension to get the currently active profile. But since my script is supposed to run in the background forever, I noticed pretty soon that something is leaking, I get a "memory full" message after some time.
I've put up a minimal example to reproduce the leak:
I assume that the problem is located within the python extension itself (no proper cleanup or something). The code in question is here:
import e32, sysinfo, xprofile
currentProfile = xprofile.get_ap()
print u"free_ram()=%d" % (int(sysinfo.free_ram())/1024)
I'm not familiar with the s60 c++ libs, maybe someone here can spot the problem?
// WORKS !
static PyObject* xprofile_get_apx(PyObject* /*self*/, PyObject* /*args*/)
MProfileEngine* profileEngine = CreateProfileEngineL();
//CleanupReleasePushL( *profileEngine );
MProfile* profile = profileEngine->ActiveProfileL();
//CleanupReleasePushL( *profile );
MProfileName const &name = profile->ProfileName();
//CleanupStack::PopAndDestroy(1); // profileEngine
return Py_BuildValue("(iu#u#)",name.Id(),(name.ShortName()).Ptr(),(name.ShortName()).Length(),(name.Name()).Ptr(), (name.Name()).Length() );