lishuyuan / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
1 stars 4 forks source link

Resource Leaking when using kSoap in Android Strict Mode #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Run android application using kSOAP with strict mode activated.
2. Strict mode error will occur each time 
org.ksoap2.transport.HttpTransportSE.call is called.

What is the expected output? What do you see instead?
No warning or error should be present. Instead it display StrictMode error 
indicating resource leakage.

What version of the product are you using? On what operating system?
kSOAP2-android-assembly-2.6.5-jar-with-dependencies.jar

Please provide any additional information below.
The following is the stack trace displayed when the error occurred.
09-12 22:00:52.120: E/StrictMode(1504): A resource was acquired at attached 
stack trace but never released. See java.io.Closeable for information on 
avoiding resource leaks.
09-12 22:00:52.120: E/StrictMode(1504): java.lang.Throwable: Explicit 
termination method 'end' not called
09-12 22:00:52.120: E/StrictMode(1504):     at 
dalvik.system.CloseGuard.open(CloseGuard.java:184)
09-12 22:00:52.120: E/StrictMode(1504):     at 
java.util.zip.Inflater.<init>(Inflater.java:82)
09-12 22:00:52.120: E/StrictMode(1504):     at 
java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:96)
09-12 22:00:52.120: E/StrictMode(1504):     at 
java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81)
09-12 22:00:52.120: E/StrictMode(1504):     at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:182)
09-12 22:00:52.120: E/StrictMode(1504):     at 
com.aa.bb.generalLibraries.XXXX.getSoapData(XXX.java:191)
09-12 22:00:52.120: E/StrictMode(1504):     at 
com.aa.bb.ksoap.SOAPServices.aaa_bbb(SOAPServices.java:290)
09-12 22:00:52.120: E/StrictMode(1504):     at 
com.aa.bb.testStubs.sample.testSoap(ComponentTestStubs.java:223)
09-12 22:00:52.120: E/StrictMode(1504):     at 
com.aa.bb.cc.SoapTestStub.onHandleIntent(SoapTestStub.java:25)
09-12 22:00:52.120: E/StrictMode(1504):     at 
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 22:00:52.120: E/StrictMode(1504):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
09-12 22:00:52.120: E/StrictMode(1504):     at 
android.os.Looper.loop(Looper.java:137)
09-12 22:00:52.120: E/StrictMode(1504):     at 
android.os.HandlerThread.run(HandlerThread.java:60)

Original issue reported on code.google.com by maziz....@gmail.com on 12 Sep 2012 at 3:06

GoogleCodeExporter commented 9 years ago
Please try with the latest release.. I believe we had that fixed recently

Original comment by mosa...@gmail.com on 12 Sep 2012 at 5:42

GoogleCodeExporter commented 9 years ago
Hi Mosabua,
Thanks for your response. By latest version do you mean 3.0.0 RC1?

Original comment by maziz....@gmail.com on 13 Sep 2012 at 2:04

GoogleCodeExporter commented 9 years ago
Dear Mosabu,
I've just tested with 3.0.0 RC1, the leakage still present. The steps to 
reproduce it is the same as before.

Original comment by maziz....@gmail.com on 13 Sep 2012 at 2:44

GoogleCodeExporter commented 9 years ago
Can you see if you can come up with a fix and send a pull request or patch?

Original comment by mosa...@gmail.com on 13 Sep 2012 at 4:41

GoogleCodeExporter commented 9 years ago
Let me see what I can do. 

Original comment by maziz....@gmail.com on 13 Sep 2012 at 5:56

GoogleCodeExporter commented 9 years ago
Hi Mosabua,
Could you have a look at my pull request containing the fix for this issue?
Regards.

Original comment by maziz....@gmail.com on 1 Oct 2012 at 10:53

GoogleCodeExporter commented 9 years ago
I am at JavaOne and will have a look when I am back.. I need to do some testing 
with it that I can not do while I am here.. but if you want I can cut another 
RC release after I pulled it in.

Original comment by mosa...@gmail.com on 2 Oct 2012 at 4:00

GoogleCodeExporter commented 9 years ago
Whichever it's convenient for you. Minor fix. Take your time.

Original comment by maziz....@gmail.com on 3 Oct 2012 at 1:45

GoogleCodeExporter commented 9 years ago
Fixed in 3.0.0-RC.2 release

Original comment by mosa...@gmail.com on 23 Oct 2012 at 4:19