hi there,
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:Code:import e32, sysinfo, xprofile while 1: currentProfile = xprofile.get_ap() print u"free_ram()=%d" % (int(sysinfo.free_ram())/1024) e32.ao_sleep(0.1)
I'm not familiar with the s60 c++ libs, maybe someone here can spot the problem?Code:// WORKS ! static PyObject* xprofile_get_apx(PyObject* /*self*/, PyObject* /*args*/) { TInt ret; MProfileEngine* profileEngine = CreateProfileEngineL(); //CleanupReleasePushL( *profileEngine ); MProfile* profile = profileEngine->ActiveProfileL(); //CleanupReleasePushL( *profile ); ret=profileEngine->ActiveProfileId(); MProfileName const &name = profile->ProfileName(); //CleanupStack::PopAndDestroy(1); // profileEngine profileEngine->Release(); return Py_BuildValue("(iu#u#)",name.Id(),(name.ShortName()).Ptr(),(name.ShortName()).Length(),(name.Name()).Ptr(), (name.Name()).Length() ); }

Reply With Quote





