Closed Bug 703602 Opened 13 years ago Closed 13 years ago

Unclosed Cursor warning in Fennec Native

Categories

(Firefox for Android Graveyard :: General, defect, P3)

All
Android
defect

Tracking

(firefox11 fixed, fennec11+)

VERIFIED FIXED
Tracking Status
firefox11 --- fixed
fennec 11+ ---

People

(Reporter: kats, Assigned: lucasr)

Details

Attachments

(1 file)

Happening on latest birch (rev 9999a423d8ab) running on a Droid Pro. I just loaded TechCrunch.com and saw this in the logcat output.

11-18 10:07:49.271  9038  9039 E Cursor  : Finalizing a Cursor that has not been deactivated or closed. database = /data/data/org.mozilla.fennec_kats/databases/favicon_urls.db, table = favicon_urls, query = SELECT favicon_url FROM favicon_urls WHERE (page_url = ?)
11-18 10:07:49.271  9038  9039 E Cursor  : android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:210)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1350)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at org.mozilla.gecko.Favicons$DatabaseHelper.getFaviconUrlForPageUrl(Favicons.java:128)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at org.mozilla.gecko.Favicons$LoadFaviconTask.doInBackground(Favicons.java:371)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at org.mozilla.gecko.Favicons$LoadFaviconTask.doInBackground(Favicons.java:215)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.os.AsyncTask$2.call(AsyncTask.java:185)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.lang.Thread.run(Thread.java:1096)
Assignee: nobody → lucasr.at.mozilla
Attachment #575470 - Flags: review?(kgupta)
Comment on attachment 575470 [details] [diff] [review]
Close cursor when getting favicon URL

I'd prefer to see something like https://wiki.mozilla.org/Fennec/NativeUI/CodingStyle#Closing_resources - although if you want to do that in a separate patch i can r+ this one.
(In reply to Kartikaya Gupta (:kats) from comment #2)
> Comment on attachment 575470 [details] [diff] [review] [diff] [details] [review]
> Close cursor when getting favicon URL
> 
> I'd prefer to see something like
> https://wiki.mozilla.org/Fennec/NativeUI/CodingStyle#Closing_resources -
> although if you want to do that in a separate patch i can r+ this one.

r+ this one and I'll upload a separate patch refactoring the other parts of the Favicons to follow the suggested idiom.
Attachment #575470 - Flags: review?(kgupta) → review+
Lucas - can we land/close this bug?
Priority: -- → P3
Pushed: http://hg.mozilla.org/projects/birch/rev/c26b7a14e5bd

Kats, I filed bug 704466 to track the promised refactoring.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Is there a way we can verify this?
I loaded TechCrunch.com and looked in aLogcat but there was no unclosed cursor warning. 
Marking as verified fixed, build: Mozilla /5.0 (Android;Linux armv7l;rv:9.0a1) Gecko/20111123 Firefox/10.0a1 Fennec/10.0a1 
Device: LG Optimus 2X (Android 2.2)
Status: RESOLVED → VERIFIED
tracking-fennec: --- → 11+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: