- Timestamp:
- Dec 19, 2013 3:39:30 AM (11 years ago)
- Location:
- pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/android
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/android/jni/Android.mk
r4697 r4698 8 8 LOCAL_LDFLAGS := $(APP_LDFLAGS) 9 9 LOCAL_LDLIBS := $(APP_LDLIBS) 10 LOCAL_SRC_FILES := $(PJDIR)/pjsip-apps/src/swig/java/output/pjsua2_wrap.cpp10 LOCAL_SRC_FILES := ../output/pjsua2_wrap.cpp 11 11 12 12 include $(BUILD_SHARED_LIBRARY) -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MainActivity.java
r4697 r4698 160 160 app.deinit(); 161 161 finish(); 162 System.gc();162 Runtime.getRuntime().gc(); 163 163 android.os.Process.killProcess(android.os.Process.myPid()); 164 164 -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java
r4697 r4698 233 233 private TransportConfig sipTpConfig = new TransportConfig(); 234 234 private String appDir; 235 236 /* Maintain reference to log writer to avoid premature cleanup by GC */ 237 private MyLogWriter logWriter; 235 238 236 239 private final String configName = "pjsua2.json"; … … 270 273 /* Set log config. */ 271 274 LogConfig log_cfg = epConfig.getLogConfig(); 272 log_cfg.setWriter(new MyLogWriter()); 275 logWriter = new MyLogWriter(); 276 log_cfg.setWriter(logWriter); 273 277 log_cfg.setDecor(log_cfg.getDecor() & 274 278 ~(pj_log_decoration.PJ_LOG_HAS_CR.swigValue() | … … 369 373 } 370 374 371 /* Suggest to delete, as we found this causes crash when the Java372 * deletes it later after lib has been destroyed.375 /* Force delete json now, as I found that Java somehow destroys it 376 * after lib has been destroyed and from non-registered thread. 373 377 */ 374 378 json.delete(); … … 415 419 } catch (Exception e) {} 416 420 417 /* Suggest to delete, as we found this causes crash when the Java418 * deletes it later after lib has been destroyed.421 /* Force delete json now, as I found that Java somehow destroys it 422 * after lib has been destroyed and from non-registered thread. 419 423 */ 420 424 json.delete(); … … 428 432 * deleted before lib is destroyed. 429 433 */ 430 System.gc(); 431 434 Runtime.getRuntime().gc(); 435 436 /* Shutdown pjsua. Note that Endpoint destructor will also invoke 437 * libDestroy(), so this will be a test of double libDestroy(). 438 */ 432 439 try { 433 440 ep.libDestroy(); 434 441 } catch (Exception e) {} 442 443 /* Force delete Endpoint here, to avoid deletion from a non- 444 * registered thread (by GC?). 445 */ 446 ep.delete(); 435 447 ep = null; 436 448 }
Note: See TracChangeset
for help on using the changeset viewer.