Skip to content

Return addGridModificationListener if pygrid is not registered.

Samuel Burbulla requested to merge bugfix/gridmodificationlistener into master

If the hierarchicalGrid of a gridView is not registered (i.e. obtained) as python object, the call to the grid modification listener leads to a segfault when e.g. creating a space on this gridView.

I found this because in dune-mmesh the interface grid can be obtained without holding an instance of the hierarchicalGrid of the interface. Unfortunately, I found no way to create and hold such instance implicitly when obtaining the interface grid. If I do it explicitly (what you will do however when you need the hierarchicalGrid) the segfault vanishes.

Because it is already assumed (and checked by assertion) that the pygrid object exists, I propose to directly leave the method if the python instance has not been found. This should not break anything, but prevents the segfault.

Merge request reports