Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

My Service has leaked ServiceConnection com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc$2@2bee8520

Rank

Total Posts: 7

Joined 2013-02-12

PM

Each time when I requestAccess from a PCC and don't wait for connection or timeout but stop my Service, following message is in my logcat:

Stacktrace:

android.app.ServiceConnectionLeakedService com.goebl.myworkouts.service.AntPlusPluginService has leaked ServiceConnection com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc$2@2bee8520 that was originally bound here
            at android
.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:936)
            
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:830)
            
at android.app.ContextImpl.bindService(ContextImpl.java:1117)
            
at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
            
at com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc.bindAndRequest(AntPluginPcc.java:646)
            
at com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc.requestAccess_Helper_SubMain(AntPluginPcc.java:557)
            
at com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc.requestAccess_Helper_Main(AntPluginPcc.java:530)
            
at com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc.requestAccess_Helper_AsyncSearchByDevNumber(AntPluginPcc.java:405)
            
at com.dsi.ant.plugins.antplus.pcc.AntPlusEnvironmentPcc.requestAccess(AntPlusEnvironmentPcc.java:238)
            
at com.goebl.myworkouts.service.AntPlusPluginService.resetEnvironmentPcc(AntPlusPluginService.java:400)
            
at com.goebl.myworkouts.service.AntPlusPluginService.startStopPlugins(AntPlusPluginService.java:181)
            
at com.goebl.myworkouts.service.DataCollectorService$1.onServiceConnected(DataCollectorService.java:206)
            
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068


The app is not terminating and it seems that this is not much of a problem, but I'm a bit concerned about it.

Should I change something to avoid this? It's not easy to detect if there are open requestAccess-calls and how long should I wait before stopping my service? What if the user has done something so that a new service is started in the meanwhile?

I'm missing something like unbind. (This is not critisism, the Pluginlib is awesome and I thank you very much for providing it. Much easier to use than the old "native" lib.)

Other question: I'm using PluginLib-Version 2.0.0, but the AntPlusPlugin.apk is Version 2.2.0. Is this OK? I haven't found a newer antpluginlib_x.x.x.jar.      
Rank

Total Posts: 23

Joined 2013-02-06

PM

I also have been encountering this "serviceConnection" leaked message, during the onStop() phase of my app where I call .releaseAccess.
LogCat output:

Service com.dsi.ant.plugins.antplus.bikespdcad.CombinedBikeSpdCadService has leaked
    ServiceConnection com
.dsi.ant.plugins.antplus.common.AntPluginService$3@2bc51dd0 that was originally bound here
android
.app.ServiceConnectionLeakedService com.dsi.ant.plugins.antplus.bikespdcad.CombinedBikeSpdCadService has leaked
    ServiceConnection com
.dsi.ant.plugins.antplus.common.AntPluginService$3@2bc51dd0 that was originally bound here
 at android
.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:936)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:830)
at android.app.ContextImpl.bindService(ContextImpl.java:1117)
at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
at com.dsi.ant.AntService.bindService(AntService.java:206)
at com.dsi.ant.plugins.antplus.common.AntPluginService.connectArsAndRepost(AntPluginService.java:369)
at com.dsi.ant.plugins.antplus.common.AntPluginService.access$1(AntPluginService.java:296)
at com.dsi.ant.plugins.antplus.common.AntPluginService$RequestAccessHandler.handleMessage(AntPluginService.java:268)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)[/color] 


I do not "unsubscribe" from events before .releaseAccess to a Pcc; Is this necessary?      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

This is a known limitation of the current plugins. There is no way to work around it right now besides waiting for the result and calling releasePcc.

However, we have introduced a new feature that returns an object when you request access that can be used to close the PCC cleanly at any time, even before the result is received. This feature should show up in the next library release.      

Signature

Dynastream Developer

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

ShaneG - 17 December 2013 09:00 AM
This is a known limitation of the current plugins. There is no way to work around it right now besides waiting for the result and calling releasePcc.

However, we have introduced a new feature that returns an object when you request access that can be used to close the PCC cleanly at any time, even before the result is received. This feature should show up in the next library release.


Any updates on this?

I would like to be able to cancel a request to connect to the wrong sensor (as it would never be found). [Current workaround is to flag the device as disconnected and releaseAccess if the access result receiver provides a PCC]      

Signature

blackramlabs.com

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Update, the new version is released http://www.thisisant.com/forum/viewthread/4357/.

Sorry to keep you waiting on so many threads arrgh :(      

Signature

Dynastream Developer

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

<deleted - duplicate post>      

Signature

Dynastream Developer

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

For now the workaround of flagging a disconnection is working well for me. My first priority is testing with the new services, but I will try and update my API version (to search for multiple device types) in the next couple of weeks and test this.

Thanks      

Signature

blackramlabs.com