maksim-s/AirMobs — Issue #1: binding to service onCreate leaks
Author: eyalto
Created: 2012-01-03 22:38:44+00:00
State: open

when chaining phone orientation re-binding to the service again cause unhanded exception

01-03 17:38:03.761: I/AirMobs::ServiceBinder(7004): control service found . attempting to bind
01-03 17:38:03.812: E/ActivityThread(7004): Activity edu.mit.media.airmobs.AirMobsActivity has leaked ServiceConnection edu.mit.media.airmobs.ServiceBinder@47bcaa90 that was originally bound here
01-03 17:38:03.812: E/ActivityThread(7004): android.app.ServiceConnectionLeaked: Activity edu.mit.media.airmobs.AirMobsActivity has leaked ServiceConnection edu.mit.media.airmobs.ServiceBinder@47bcaa90 that was originally bound here
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread$PackageInfo$ServiceDispatcher.(ActivityThread.java:1121)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:1016)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ContextImpl.bindService(ContextImpl.java:946)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.content.ContextWrapper.bindService(ContextWrapper.java:347)
01-03 17:38:03.812: E/ActivityThread(7004):	at edu.mit.media.airmobs.ServiceBinder.bindToService(ServiceBinder.java:59)
01-03 17:38:03.812: E/ActivityThread(7004):	at edu.mit.media.airmobs.AirMobsActivity.onCreate(AirMobsActivity.java:46)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3815)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread.access$2400(ActivityThread.java:125)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.os.Looper.loop(Looper.java:123)
01-03 17:38:03.812: E/ActivityThread(7004):	at android.app.ActivityThread.main(ActivityThread.java:4627)
01-03 17:38:03.812: E/ActivityThread(7004):	at java.lang.reflect.Method.invokeNative(Native Method)
01-03 17:38:03.812: E/ActivityThread(7004):	at java.lang.reflect.Method.invoke(Method.java:521)
01-03 17:38:03.812: E/ActivityThread(7004):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
01-03 17:38:03.812: E/ActivityThread(7004):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-03 17:38:03.812: E/ActivityThread(7004):	at dalvik.system.NativeStart.main(Native Method)
01-03 17:38:03.824: I/Airmobs::MonitorService(7004): status request returning counter = 184