New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending non-transient object, clashing with other extensions #24

Closed
Eneroth3 opened this Issue Feb 11, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@Eneroth3
Copy link

Eneroth3 commented Feb 11, 2019

Dezmo has reported in the SketchUp forum that his code clashes with TrueBend, after TrueBend has been used. Calling PickHelper#pick_segment inside his namespace with seemingly malformed arguments raises an exception in TrueBend's HighDpiPickHelper.

https://forums.sketchup.com/t/truebend-re-defined-method-for-pick-segment-points/87777

It appears TrueBend is extending a PickHelper object that isn't actually transient, but reused as return value by View#pick_helper method.

https://github.com/thomthom/true-bend/blob/master/src/tt_truebend/dpi/view.rb#L126

Running this snippet over and over shows the same object ID being re-used.

Sketchup.active_model.active_view.object_id

To fix this clash, perhaps the delegation pattern could be used inside HighDpiPickHelper just as it is used HighDpiView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment