Skip to content

Commit ccbffb8

Browse files
committed
possible fix for mysterious crash in native code
1 parent 192d04c commit ccbffb8

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

platform/android/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.cgogolin.penandpdf"
4-
android:versionCode="66"
5-
android:versionName="1.3.5"
4+
android:versionCode="67"
5+
android:versionName="1.3.6"
66
android:installLocation="auto">
77
<permission android:name="com.cgogolin.penandpdf.LAUNCH_PEN_AND_PDF_FILE_CHOOSER" />
88
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

platform/android/src/com/cgogolin/penandpdf/MuPDFCore.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ private native void updatePageInternal(Bitmap bitmap,
110110
private native void abortCookie(long cookie);
111111
private native boolean cookieAborted(long cookie);
112112

113-
114-
public native void setInkThickness(float inkThickness);
115-
public native void setInkColor(float r, float g, float b);
116-
public native void setHighlightColor(float r, float g, float b);
117-
public native void setUnderlineColor(float r, float g, float b);
118-
public native void setStrikeoutColor(float r, float g, float b);
119-
public native void setTextAnnotIconColor(float r, float g, float b);
113+
/* making these non synchronized probably lead to a hard to debug crash in native code */
114+
public synchronized native void setInkThickness(float inkThickness);
115+
public synchronized native void setInkColor(float r, float g, float b);
116+
public synchronized native void setHighlightColor(float r, float g, float b);
117+
public synchronized native void setUnderlineColor(float r, float g, float b);
118+
public synchronized native void setStrikeoutColor(float r, float g, float b);
119+
public synchronized native void setTextAnnotIconColor(float r, float g, float b);
120120
public synchronized native int insertBlankPageBeforeInternal(int position);
121121

122122
public synchronized native boolean javascriptSupported();

0 commit comments

Comments
 (0)