Commit c031e4c
committed
gc: fix instance allocation counting
A class destructor is not called if an exception is thrown when
executing the constructor. This caused an issue where if an error
occured during construction of NSFW objects, the instance coutn would
never be decremented.
This commit moves the increment step at the end of the constructor,
after which nothing can error out.
Signed-off-by: Paul Maréchal <[email protected]>1 parent 94e83f0 commit c031e4c
2 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
687 | 696 | | |
688 | 697 | | |
689 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
71 | 67 | | |
72 | 68 | | |
73 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments