Page MenuHome

Fix: Exception in tree view code in new case
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Nov 12 2021, 5:05 AM.

Details

Summary

This isn't a problem in 3.0 or master, but I'm porting the spreadsheet
data set region to a tree view and ran into this. This line meant to
check whether the function was empty, but instead it calls the function,
resulting in a std::bad_function_call exception.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Nov 12 2021, 5:05 AM
Hans Goudey (HooglyBoogly) created this revision.
Julian Eisel (Severin) requested changes to this revision.Nov 19 2021, 7:01 PM

Actually the function should be called here. It's asking "should this tree item be the active one?", and if so, it activates it. And this is done via a delayed callback because only after reconstruction is complete, we can reliably detect if a state change happened (and correctly call the on_activate() of the item).

But of course, it makes sense to check if it's set first.

This revision now requires changes to proceed.Nov 19 2021, 7:01 PM

Oh wow, that was obvious.. Here's a correct version.

This revision is now accepted and ready to land.Nov 19 2021, 11:05 PM