Skip to content

Commit 00bd269

Browse files
committed
[SofaPyhon3/Plugin] Fix regression introduced in PR #4243
To fix memory error in PR sofa-framework#243 There is the need to get the latest data by calling getValue(). The way it was done in the PR is wrong because it is using a begin/end edit pairs which trigger the DDG's follower to notify the data is dirty (while it is not). The consequence was that every call on read access eg: print(myobjec.position.value) was triggering the data change mecanisme
1 parent f03b1c5 commit 00bd269

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Plugin/src/SofaPython3/DataHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ size_t getSize(BaseData* self)
294294

295295
py::buffer_info toBufferInfo(BaseData& m)
296296
{
297-
scoped_read_access guard(&m);
297+
m.updateIfDirty();
298298

299299
const AbstractTypeInfo& nfo { *m.getValueTypeInfo() };
300300
auto itemNfo = nfo.BaseType();

0 commit comments

Comments
 (0)