Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#247 Crash on bookmark adding

Android
closed-fixed
Vadim Lopatin
None
5
2013-02-07
2012-12-24
Alexey Ivanov
No

Hi,

I encountered with error in CoolReader 3.1.2-27: crash on bookmark adding attempt.
Steps to reproduce:
1) Launch app.
2) Open book and add many bookmarks.
3) Try to add bookmark.
4) Notice issue.

Log is attached.

It seems you need to add DeleteLocalRef(fieldid) in CRFieldAccessor::~CRFieldAccessor.

Discussion

  • Alexey Ivanov
    Alexey Ivanov
    2012-12-24

    crash log

     
    Attachments
  • Alexey Ivanov
    Alexey Ivanov
    2012-12-24

    Suggestion about CRFieldAccessor::~CRFieldAccessor was wrong.
    Solution that works for me is following:

    diff --git a/android/jni/cr3java.h b/android/jni/cr3java.h
    index 5a02dcf..5a979d6 100644
    --- a/android/jni/cr3java.h
    +++ b/android/jni/cr3java.h
    @@ -84,6 +84,12 @@ public:
    {
    cls = env->FindClass(className);
    }
    + // fix crash on bookmark adding.
    + ~CRClassAccessor()
    + {
    + env->DeleteLocalRef(cls);
    + }
    + //
    };

     
  • Vadim Lopatin
    Vadim Lopatin
    2013-02-04

    • assigned_to: nobody --> buggins
     
  • Vadim Lopatin
    Vadim Lopatin
    2013-02-07

    • status: open --> closed-fixed