OSDN Git Service

Wrap reference count to one module
authorjiangmin <jiangming.wu@intel.com>
Wed, 6 Jan 2016 02:40:12 +0000 (10:40 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 20 Jul 2016 09:53:23 +0000 (17:53 +0800)
commitecf3a638e2c01e7f1d3694c1c43d9d89955f14da
treeddb3027e8863397645ce6ff912164ecd5485518b
parent6269837997110bfdf1436e35bfacc9939cc3fd1a
Wrap reference count to one module

The reference count should be not managed by two module
(PdfRenderer and PdfEditor) separately.
It will cause memory leak and crash.
FPDF_InitLibrary will be call twice and excute
"g_FPDFAPI_pDefaultMgr = new CPDF_ModuleMgr;" twice.
Memory leak will happen.
PdfEditor will call FPDF_DestroyLibrary just after
PdfRenderer calls FPDF_InitLibrary. PdfRenderer
will execute FPDF's API and crash for null point of
CPDF_ModuleMgr::Get() due to PdfEditor's calling for
FPDF_DestroyLibrary.
So we merge the reference count of FPDF library to
PdfLibrary.cpp from PdfEditor.cpp and PdfRenderer.cpp.

Change-Id: I984a268ddd2d6d97e086e51d6459751feeaf372a
Signed-off-by: Wu Jiangming <jiangmin.wu@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15089
Reviewed-on: https://android.intel.com:443/455409
core/jni/Android.mk
core/jni/android/graphics/pdf/PdfEditor.cpp
core/jni/android/graphics/pdf/PdfLibrary.cpp [new file with mode: 0644]
core/jni/android/graphics/pdf/PdfRenderer.cpp