mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
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:
parent
049c25f16d
commit
9f05d45e05
1 changed files with 10 additions and 4 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue