Mercurial > dwindows
comparison android/dw.cpp @ 2633:3d20fcfd8583
Android: Fix startup failure when not calling dw_app_id_set().
dw_init() would have an exception with no application name.
So create a default application name with getprogname().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 09 Aug 2021 22:07:54 +0000 |
parents | 04d5c8147e33 |
children | 22105f99dd6a |
comparison
equal
deleted
inserted
replaced
2632:04d5c8147e33 | 2633:3d20fcfd8583 |
---|---|
7055 if(!_dw_app_id[0]) | 7055 if(!_dw_app_id[0]) |
7056 { | 7056 { |
7057 /* Generate an Application ID based on the PID if all else fails. */ | 7057 /* Generate an Application ID based on the PID if all else fails. */ |
7058 snprintf(_dw_app_id, _DW_APP_ID_SIZE, "%s.pid.%d", DW_APP_DOMAIN_DEFAULT, getpid()); | 7058 snprintf(_dw_app_id, _DW_APP_ID_SIZE, "%s.pid.%d", DW_APP_DOMAIN_DEFAULT, getpid()); |
7059 } | 7059 } |
7060 if(!_dw_app_name[0]) | |
7061 { | |
7062 const char *name = getprogname(); | |
7063 | |
7064 if(name) | |
7065 strncpy(_dw_app_name, name, _DW_APP_ID_SIZE); | |
7066 } | |
7060 | 7067 |
7061 if((env = (JNIEnv *)pthread_getspecific(_dw_env_key))) | 7068 if((env = (JNIEnv *)pthread_getspecific(_dw_env_key))) |
7062 { | 7069 { |
7063 // Construct a String | 7070 // Construct a String |
7064 jstring appid = env->NewStringUTF(_dw_app_id); | 7071 jstring appid = env->NewStringUTF(_dw_app_id); |