mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix windows popup (flutter/engine#21522)
This commit is contained in:
parent
b493fa3af3
commit
9377073f34
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "flutter/fml/backtrace.h"
|
||||
#include "flutter/fml/build_config.h"
|
||||
#include "flutter/fml/command_line.h"
|
||||
#include "flutter/fml/logging.h"
|
||||
@ -10,6 +11,7 @@
|
||||
#include "flow_test_utils.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
fml::InstallCrashHandler();
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);
|
||||
|
||||
|
||||
@ -7,10 +7,15 @@
|
||||
#include <cxxabi.h>
|
||||
#include <dlfcn.h>
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <csignal>
|
||||
#include <sstream>
|
||||
|
||||
#if OS_WIN
|
||||
#include <crtdbg.h>
|
||||
#include <debugapi.h>
|
||||
#endif
|
||||
|
||||
#include "flutter/fml/logging.h"
|
||||
|
||||
namespace fml {
|
||||
@ -126,6 +131,12 @@ static void ToggleSignalHandlers(bool set) {
|
||||
}
|
||||
|
||||
void InstallCrashHandler() {
|
||||
#if OS_WIN
|
||||
if (!IsDebuggerPresent()) {
|
||||
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
|
||||
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
|
||||
}
|
||||
#endif
|
||||
ToggleSignalHandlers(true);
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "flutter/fml/backtrace.h"
|
||||
#include "flutter/fml/command_line.h"
|
||||
#include "flutter/fml/icu_util.h"
|
||||
#include "flutter/fml/logging.h"
|
||||
@ -24,6 +25,7 @@
|
||||
#include "txt_test_utils.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
fml::InstallCrashHandler();
|
||||
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);
|
||||
txt::SetCommandLine(cmd);
|
||||
txt::SetFontDir(flutter::testing::GetFixturesPath());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user