mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-12 08:47:50 +01:00
saw a crash, so gather more info if it happens again.
This commit is contained in:
parent
68bb8a1268
commit
f7258f29e8
1 changed files with 16 additions and 10 deletions
|
@ -269,15 +269,21 @@ tilesArrayToTileSet( JNIEnv* env, jintArray jtiles, TrayTileSet* tset )
|
||||||
|
|
||||||
#ifdef GAMEPTR_IS_OBJECT
|
#ifdef GAMEPTR_IS_OBJECT
|
||||||
static JNIState*
|
static JNIState*
|
||||||
getState( JNIEnv* env, GamePtrType gamePtr )
|
getState( JNIEnv* env, GamePtrType gamePtr, const char* func )
|
||||||
{
|
{
|
||||||
XP_ASSERT( NULL != gamePtr );
|
#ifdef DEBUG
|
||||||
|
if ( NULL == gamePtr ) {
|
||||||
|
XP_LOGF( "ERROR: getState() called from %s() with null gamePtr",
|
||||||
|
func );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
XP_ASSERT( NULL != gamePtr ); /* fired */
|
||||||
jmethodID mid = getMethodID( env, gamePtr, "ptr", "()I" );
|
jmethodID mid = getMethodID( env, gamePtr, "ptr", "()I" );
|
||||||
XP_ASSERT( !!mid );
|
XP_ASSERT( !!mid );
|
||||||
return (JNIState*)(*env)->CallIntMethod( env, gamePtr, mid );
|
return (JNIState*)(*env)->CallIntMethod( env, gamePtr, mid );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define getState( env, gamePtr ) ((JNIState*)(gamePtr))
|
# define getState( env, gamePtr, func ) ((JNIState*)(gamePtr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL
|
JNIEXPORT jint JNICALL
|
||||||
|
@ -891,12 +897,12 @@ struct _JNIState {
|
||||||
MPSLOT
|
MPSLOT
|
||||||
};
|
};
|
||||||
|
|
||||||
#define XWJNI_START() { \
|
#define XWJNI_START() { \
|
||||||
JNIState* state = getState( env, gamePtr ); \
|
JNIState* state = getState( env, gamePtr, __func__ ); \
|
||||||
MPSLOT; \
|
MPSLOT; \
|
||||||
MPASSIGN( mpool, state->mpool); \
|
MPASSIGN( mpool, state->mpool); \
|
||||||
XP_ASSERT( !!state->globalJNI ); \
|
XP_ASSERT( !!state->globalJNI ); \
|
||||||
map_thread( &state->globalJNI->ti, env ); \
|
map_thread( &state->globalJNI->ti, env ); \
|
||||||
|
|
||||||
#define XWJNI_START_GLOBALS() \
|
#define XWJNI_START_GLOBALS() \
|
||||||
XWJNI_START() \
|
XWJNI_START() \
|
||||||
|
@ -990,7 +996,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame
|
||||||
JNIEXPORT void JNICALL Java_org_eehouse_android_xw4_jni_XwJNI_game_1dispose
|
JNIEXPORT void JNICALL Java_org_eehouse_android_xw4_jni_XwJNI_game_1dispose
|
||||||
( JNIEnv* env, jclass claz, GamePtrType gamePtr )
|
( JNIEnv* env, jclass claz, GamePtrType gamePtr )
|
||||||
{
|
{
|
||||||
JNIState* state = getState( env, gamePtr );
|
JNIState* state = getState( env, gamePtr, __func__ );
|
||||||
LOG_FUNC();
|
LOG_FUNC();
|
||||||
|
|
||||||
#ifdef MEM_DEBUG
|
#ifdef MEM_DEBUG
|
||||||
|
|
Loading…
Add table
Reference in a new issue