Skip to content

Ensure get_geo_layer does not return dangling ref#1130

Merged
eivindjahren merged 1 commit intomainfrom
fix_dangling_layer
Mar 3, 2026
Merged

Ensure get_geo_layer does not return dangling ref#1130
eivindjahren merged 1 commit intomainfrom
fix_dangling_layer

Conversation

@eivindjahren
Copy link
Collaborator

Resolves #1124

@eivindjahren eivindjahren self-assigned this Mar 3, 2026
@eivindjahren eivindjahren moved this to Ready for Review in SCOUT Mar 3, 2026
def get_geo_layer(self):
"""Returns the underlying geometric layer."""
return self._get_layer()
return self._get_layer().setParent(self)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have very little context of this library.
When I read this code I would image a set method would return None.
Is this not true in this case?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aka if it should have been among the lines:

layer = self._get_layer()
layer.setParent(self)
return layer

If you know what I mean

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is equivalent as it does return self :)

@SAKavli SAKavli moved this from Ready for Review to Reviewed in SCOUT Mar 3, 2026
Copy link

@SAKavli SAKavli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure this can be merged. Had a small question though.

@eivindjahren eivindjahren merged commit 3c67372 into main Mar 3, 2026
13 checks passed
@eivindjahren eivindjahren deleted the fix_dangling_layer branch March 3, 2026 13:54
@github-project-automation github-project-automation bot moved this from Reviewed to Done in SCOUT Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Freeing a FaultBlockLayer may leave a dangling Layer

2 participants