313 | | There are two problems with Java garbage collector (gc): |
314 | | - it delays the destruction of Java objects (including pjsua2 objects), causing the code in object's destructor to be executed out of order |
315 | | - the gc operation may be run on different thread, not previously registered to PJLIB |
316 | | |
317 | | Due to problems above, '''application MUST immediately destroy pjsua2 objects using object's delete() method''', instead of relying on the gc to clean up the object. |
318 | | |
319 | | For example, to delete an Account: |
320 | | |
321 | | {{{ |
322 | | acc.delete(); |
323 | | }}} |
| 313 | Please check this pjsua2 book page about [http://www.pjsip.org/docs/book-latest/html/intro_pjsua2.html#problems-with-garbage-collection problems with GC]. |