Repository navigation
Commit ddb4643
fix(lwjgl3): switch GLFWGamepadState memory strategy to fix double free
* GLFWGamepadState creation with `.create()` creates a java native
ByteBuffer backing the GLFWGamepadState. The GLFWGamepadState's
`.close()` uses the NativeResource `.close()` default implementation,
that calls `.free()`. Which, at some point, causes a crash from
trying to free a java natively allocated object. That manifests as
a double free.
* As a fix, either using `.create()` with no `.close()`, letting the
JVM handle the gamepad state, or using `.malloc()` with `.close()` or
`.free()`, handling the cpp native memory manually.
Co-authored-by: Claude <noreply@anthropic.com>1 parent d95baae commit ddb4643
1 file changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1156 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1157 | 1156 | | |
1158 | 1157 | | |
1159 | 1158 | | |
| |||
0 commit comments