Ignore:
Timestamp:
Aug 26, 2014 7:27:23 AM (10 years ago)
Author:
nanang
Message:

Re #1768: Add forced GC to libDestroy() in SWIG Java.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/swig/pjsua2.i

    r4845 r4906  
    103103 
    104104%include "pjsua2/media.hpp" 
    105 %include "pjsua2/endpoint.hpp" 
    106105%include "pjsua2/presence.hpp" 
    107106%include "pjsua2/account.hpp" 
     
    113112%ignore pj::JsonDocument::getPool; 
    114113%include "pjsua2/json.hpp" 
     114 
     115// Try force Java GC before destroying the lib: 
     116// - to avoid late destroy of PJ objects by GC 
     117// - to avoid destruction of PJ objects from a non-registered GC thread 
     118#ifdef SWIGJAVA 
     119%rename(libDestroy_) pj::Endpoint::libDestroy; 
     120%typemap(javacode) pj::Endpoint %{ 
     121  public void libDestroy(long prmFlags) throws java.lang.Exception { 
     122        Runtime.getRuntime().gc(); 
     123        libDestroy_(prmFlags); 
     124  } 
     125 
     126  public void libDestroy() throws java.lang.Exception { 
     127        Runtime.getRuntime().gc(); 
     128        libDestroy_(); 
     129  } 
     130%} 
     131#endif 
     132 
     133%include "pjsua2/endpoint.hpp" 
     134 
Note: See TracChangeset for help on using the changeset viewer.