Skip to content

Commit f89b9fd

Browse files
sunnylqmzmxv
authored andcommitted
Release playerPool when reload (#534)
1 parent 43b54f4 commit f89b9fd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

android/src/main/java/com/zmxv/RNSound/RNSoundModule.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ public void release(final Double key) {
316316
}
317317
}
318318
}
319+
320+
@Override
321+
public void onCatalystInstanceDestroy() {
322+
for (Map.Entry<String, String> entry : this.playerPool.entrySet()) {
323+
release(entry.getKey());
324+
}
325+
}
319326

320327
@ReactMethod
321328
public void setVolume(final Double key, final Float left, final Float right) {

0 commit comments

Comments
 (0)