Skip to content

Commit

Permalink
Merge pull request #602 from Micheus/mv/v2.4-fix-geom-graph-window-crash
Browse files Browse the repository at this point in the history
Preventing Wings3D hard crash on issue related to Geometry Graph window
  • Loading branch information
dgud authored Jan 2, 2025
2 parents c17b3d9 + 3f9df66 commit 8059bae
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/wings_geom_win.erl
Original file line number Diff line number Diff line change
Expand Up @@ -566,14 +566,18 @@ handle_event(#wx{event=#wxList{type=Op, itemIndex=Indx, col=Col}},

handle_event(#wx{event=#wxTree{type=command_tree_sel_changed, item=Indx}},
#state{name=Name, tree=Tree} = State) ->
{_, Folder} = lists:keyfind(Indx, 1, Tree),
Apply = fun(#st{pst=Pst0} = St) ->
{_,Fld} = gb_trees:get(?FOLDERS, Pst0),
Pst = gb_trees:enter(?FOLDERS, {Folder,Fld}, Pst0),
send_client({update_state,St#st{pst=Pst}}),
keep
end,
wings_wm:psend(Name, {apply, false, Apply}),
case lists:keyfind(Indx, 1, Tree) of
{_, Folder} ->
Apply = fun(#st{pst=Pst0} = St) ->
{_,Fld} = gb_trees:get(?FOLDERS, Pst0),
Pst = gb_trees:enter(?FOLDERS, {Folder,Fld}, Pst0),
send_client({update_state,St#st{pst=Pst}}),
keep
end,
wings_wm:psend(Name, {apply, false, Apply});
_ ->
ignore
end,
{noreply, State};

handle_event(#wx{event=#wxTree{type=command_tree_item_menu, item=Indx, pointDrag=Pos0}},
Expand Down

0 comments on commit 8059bae

Please sign in to comment.