From c9b852f88c563a61dfc250ec4a6842cd8afa322d Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Tue, 14 Jun 2016 11:11:48 +0200 Subject: [PATCH] Fix leak on Android < IceCream when workerGroup hasn't been initialized --- .../kdeconnect/Backends/LanBackend/LanLinkProvider.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java b/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java index c96f1dc0..198ceec7 100644 --- a/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java +++ b/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java @@ -482,8 +482,12 @@ public class LanLinkProvider extends BaseLinkProvider { public void onStop() { //Log.i("KDE/LanLinkProvider", "onStop"); try { - workerGroup.shutdownGracefully(); - bossGroup.shutdownGracefully(); + if (workerGroup != null) { + workerGroup.shutdownGracefully(); + } + if (bossGroup != null) { + bossGroup.shutdownGracefully(); + } udpGroup.shutdownGracefully(); clientGroup.shutdownGracefully(); }catch (Exception e){