@@ -402,22 +402,23 @@ Future<std::string> GetAnalyticsInstanceId() {
402
402
if (future_data) {
403
403
bool success =
404
404
result_code == util::kFutureResultSuccess && result != nullptr ;
405
+ FutureHandleId future_id =
406
+ reinterpret_cast <FutureHandleId>(callback_data);
407
+ FutureHandle handle (future_id);
405
408
future_data->api ()->CompleteWithResult (
406
- SafeFutureHandle<std::string>(
407
- *(reinterpret_cast <FutureHandle*>(&callback_data))),
408
- success ? 0 : -1 ,
409
+ handle, success ? 0 : -1 ,
409
410
success ? " "
410
411
: status_message ? status_message
411
412
: " Unknown error occurred" ,
412
- // Both JStringToString and GetMessageFromException are able to
413
- // handle a nullptr being passed in, and neither deletes the
414
- // object passed in (so delete it below).
413
+ // Both JStringToString and GetMessageFromException are
414
+ // able to handle a nullptr being passed in, and neither
415
+ // deletes the object passed in (so delete it below).
415
416
success ? util::JStringToString (env, result)
416
417
: util::GetMessageFromException (env, result));
417
418
}
418
419
if (result) env->DeleteLocalRef (result);
419
420
},
420
- *( reinterpret_cast <void * const *>(&future_handle )),
421
+ reinterpret_cast <void *>(safe_future_handle. get (). id ( )),
421
422
internal::kAnalyticsModuleName );
422
423
env->DeleteLocalRef (task);
423
424
} else {
0 commit comments