sometimes when return from background ChatDelegate is the first to try

to reference JNIThread. Until I can make that work, just finish() --
to avoid crashes.
This commit is contained in:
Eric House 2016-04-07 09:22:41 -07:00
parent 049c25f16d
commit 9f05d45e05

View file

@ -117,16 +117,22 @@ public class ChatDelegate extends DelegateBase {
@Override @Override
protected void onResume() protected void onResume()
{ {
s_visibleThis = this;
m_jniThreadRef = JNIThread.getRetained( m_rowid );
Assert.assertNotNull( m_jniThreadRef );
super.onResume(); super.onResume();
m_jniThreadRef = JNIThread.getRetained( m_rowid );
if ( null == m_jniThreadRef ) {
DbgUtils.logf( "ChatDelegate.onResume(): m_jniThreadRef null; exiting" );
finish();
} else {
s_visibleThis = this;
}
} }
@Override @Override
protected void onPause() protected void onPause()
{ {
m_jniThreadRef.release(); if ( null != m_jniThreadRef ) {
m_jniThreadRef.release();
}
s_visibleThis = null; s_visibleThis = null;
super.onPause(); super.onPause();
} }