Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
runtime
bin
error_exit.cc
Go to the documentation of this file.
1
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#include "
bin/error_exit.h
"
6
7
#include "
bin/eventhandler.h
"
8
#include "
bin/platform.h
"
9
#include "
bin/process.h
"
10
#include "
include/dart_api.h
"
11
#include "
platform/assert.h
"
12
#include "
platform/globals.h
"
13
#include "
platform/syslog.h
"
14
15
namespace
dart
{
16
namespace
bin {
17
18
void
ErrorExit
(
int
exit_code,
const
char
*
format
, ...) {
19
va_list arguments;
20
va_start
(arguments,
format
);
21
Syslog::VPrintErr
(
format
, arguments);
22
va_end
(arguments);
23
24
// Sometimes ErrorExit is called even before we have entered an isolate.
25
// We need to shutdown the isolate only if one exists.
26
if
(
Dart_CurrentIsolate
() !=
nullptr
) {
27
Dart_ShutdownIsolate
();
28
}
29
30
// Terminate process exit-code handler.
31
Process::TerminateExitCodeHandler
();
32
33
char
*
error
=
Dart_Cleanup
();
34
if
(
error
!=
nullptr
) {
35
Syslog::PrintErr
(
"VM cleanup failed: %s\n"
,
error
);
36
free(
error
);
37
}
38
39
Process::ClearAllSignalHandlers
();
40
EventHandler::Stop
();
41
Platform::Exit
(exit_code);
42
}
43
44
}
// namespace bin
45
}
// namespace dart
assert.h
dart::Syslog::PrintErr
static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
dart::Syslog::VPrintErr
VPrintErr(format, args)
dart::bin::EventHandler::Stop
static void Stop()
Definition:
eventhandler.cc:40
dart::bin::Platform::Exit
static DART_NORETURN void Exit(int exit_code)
dart::bin::Process::TerminateExitCodeHandler
static void TerminateExitCodeHandler()
dart::bin::Process::ClearAllSignalHandlers
static void ClearAllSignalHandlers()
Definition:
process.cc:70
dart_api.h
error_exit.h
eventhandler.h
error
const uint8_t uint32_t uint32_t GError ** error
Definition:
fl_pixel_buffer_texture_test.cc:40
format
uint32_t uint32_t * format
Definition:
fl_texture_registrar_test.cc:41
dart::bin::va_start
va_start(args, format)
dart::bin::va_end
va_end(args)
dart::bin::ErrorExit
void ErrorExit(int exit_code, const char *format,...)
Definition:
error_exit.cc:18
dart::bin::Dart_ShutdownIsolate
Dart_ShutdownIsolate()
dart
Definition:
dart_vm.cc:33
dart::Dart_CurrentIsolate
DART_EXPORT Dart_Isolate Dart_CurrentIsolate()
Definition:
dart_api_impl.cc:1454
dart::Dart_Cleanup
DART_EXPORT char * Dart_Cleanup()
Definition:
dart_api_impl.cc:1180
globals.h
syslog.h
platform.h
process.h
Generated on Sun Jun 23 2024 21:55:22 for Flutter Engine by
1.9.4