Commit 121b012
committed
fix: Initialize VIPS_INIT only once
Mihon was crashing somethimes crashing when decoding the first image. I
notice Mihon was decoding two images at the same time, which made me
think it could be a threading issue. Reading libvips documentation, it
states that it is safe, but VIPS_INIT must only be called in a
single-thread. I was calling VIPS_INIT for every decoder created, which
I believe was the issue.
This commit moves VIPS_INIT to JNI_OnLoad, which is called only once
when the library is loaded.1 parent 94ad0de commit 121b012
2 files changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 29 | | |
36 | 30 | | |
37 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
0 commit comments