Commit e43ffdc
committed
fix Mac teardown crashes by correcting QObject ownership hierarchy
The application was crashing on macOS during shutdown due to improper
parenting of UI components. When objects like delegates or models are
parented to the main Widget instead of the View, they can be destroyed
out of order, leading to use-after-free errors when the View attempts to
access them during its own destruction.
- Parent GroupModel and GroupProxyModel to m_table instead of 'this'.
- Parent GroupDelegate and TimerDelegate to their respective views.
- Ensure the lifecycle of the delegate matches the lifecycle of the view
to prevent segmentation faults during signal disconnection.
- Restore heap allocation for GroupModel to ensure Qt's ownership system
manages its cleanup correctly.1 parent 92cd4e3 commit e43ffdc
3 files changed
Lines changed: 22 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
832 | | - | |
833 | 832 | | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | 833 | | |
841 | 834 | | |
842 | 835 | | |
| |||
849 | 842 | | |
850 | 843 | | |
851 | 844 | | |
852 | | - | |
853 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
950 | | - | |
951 | | - | |
952 | 950 | | |
953 | 951 | | |
954 | 952 | | |
| |||
964 | 962 | | |
965 | 963 | | |
966 | 964 | | |
967 | | - | |
| 965 | + | |
968 | 966 | | |
969 | 967 | | |
970 | 968 | | |
| |||
978 | 976 | | |
979 | 977 | | |
980 | 978 | | |
981 | | - | |
| 979 | + | |
982 | 980 | | |
983 | 981 | | |
984 | 982 | | |
| |||
1012 | 1010 | | |
1013 | 1011 | | |
1014 | 1012 | | |
1015 | | - | |
| 1013 | + | |
1016 | 1014 | | |
1017 | 1015 | | |
1018 | 1016 | | |
1019 | 1017 | | |
1020 | 1018 | | |
1021 | 1019 | | |
1022 | 1020 | | |
1023 | | - | |
| 1021 | + | |
1024 | 1022 | | |
1025 | 1023 | | |
1026 | 1024 | | |
1027 | 1025 | | |
1028 | 1026 | | |
1029 | 1027 | | |
1030 | 1028 | | |
1031 | | - | |
| 1029 | + | |
1032 | 1030 | | |
1033 | 1031 | | |
1034 | 1032 | | |
1035 | 1033 | | |
1036 | 1034 | | |
1037 | | - | |
| 1035 | + | |
1038 | 1036 | | |
1039 | 1037 | | |
1040 | 1038 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
| 177 | + | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments