I'm trying to create a Python extension module to wrap some standard (non-Symbian) C++ classes that I have. Working from the Noddy example in the documentation I was able to create a module (called generic) with a Python type (called Project) that has a couple of members on it and run it on my E71. From there I added a simple C++ class to the extension module build but did not use the class at all within the extension code. The class looks like:

Code:
#ifndef PROJECT_H_
#define PROJECT_H_

#include <string>

namespace Generic
{
namespace Domain
{

class Project
{
public:
	Project( std::string projectName, std::string projectDescription );
	virtual ~Project();
	
	std::string getProjectName(); // { return projectName; }
	std::string getProjectDescription(); // { return projectDescription; }
	
private:
	std::string projectName;
	std::string projectDescription;
};

}
}
#endif /* PROJECT_H_ */
After this change, when I import the module the Python shell simply disappears (crash with no messages) as soon as I hit return on the import statement in the shell.

If I remove the virtual destructor (in the project class above) and rebuild I am again able to load the module on my E71. It turns out that if I add any virtual function (it isn't particular to the destructor) to the C++ Project class the module will crash the Python shell on import on the device.

Does anyone have any idea what's causing this? I've been unable to find any clues either on this forum or Googling.

I'm using PyS60 1.9.4 with Carbide C++ 2.0 and have a complete example Carbide project available for anyone who is interested in trying this ... I wasn't sure where to post the code. I got the same behavior from PyS60 1.9.2 as well.

Thanks for your help.

Pete