Also set adapter to null in unload method to prevent memory leak

This commit is contained in:
Ghost_chu committed 2021-06-05 18:12:08 +08:00
1 parent d2af7ac3f2
commit 994a163207
1 file changed
+2
@@ -386,6 +386,8 @@ public class VirtualDisplayItem extends DisplayItem {
packetSenders.clear();
if (packetAdapter != null) {
protocolManager.removePacketListener(packetAdapter);
//Prevent memory leak
packetAdapter = null;
}
if (asyncPacketSenderTask != null) {
asyncPacketSenderTask.stop();