[pygccxml-development] Call policy for a function returning a map
Brought to you by:
mbaas,
roman_yakovenko
From: Vincent F. <vin...@gm...> - 2008-07-30 08:17:42
|
I'm getting segmentation fault errors trying to replace data in a map. I've have the following attribute in my class : std::map<int,property> properties ; I get this map from a getter function with the following signature: map<int,property> & dataBase::getProperties(void) { return properties; } Then the method is called from another class in the C++ code : map<int,property> &target=DB.getProperties(); And I try to change data in it : target[tmpProperty.id]=tmpProperty; I get the segmentation fault at this line. The compiled C++ code is completely working alone, I allready tested it. I can load a file using one of my functions from C++ directly without any problem, but when I try to use this same function from Python, I get this segfault. I think the problem comes from a bad call policy fro this getProperties() function, but I'm not really sure. I'm currently using the following one : function.call_policies = call_policies.return_value_policy(call_policies.reference_existing_object) Thanks in advance for any help! |