Commit 28357f3
committed
ensure feature is destroyed to release memory
I think feature.Destroy() will cause g to be destroyed.
The seg fault mentioned in the deleted comment happens because when defer g.Destroy() and defer feature.Destroy() are included, whichever happens second tries to destroy the geometry object that was already removed by the other call.
When only g.Destroy() is called, g is destroyed, but the rest of the feature remains causing the memory leak.1 parent 366b2a4 commit 28357f3
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
| |||
0 commit comments