Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
5feabfac
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5feabfac
编写于
3月 16, 2020
作者:
B
Bennik2000
提交者:
jp9000
5月 19, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Fix wrong path in the crash message dialog
Closes obsproject/obs-studio#2290
上级
f1b97b78
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
6 deletion
+27
-6
UI/obs-app.cpp
UI/obs-app.cpp
+27
-6
未找到文件。
UI/obs-app.cpp
浏览文件 @
5feabfac
...
...
@@ -49,6 +49,7 @@
#ifdef _WIN32
#include <windows.h>
#include <filesystem>
#else
#include <signal.h>
#include <pthread.h>
...
...
@@ -1888,8 +1889,7 @@ static int run_program(fstream &logFile, int argc, char *argv[])
#define CRASH_MESSAGE \
"Woops, OBS has crashed!\n\nWould you like to copy the crash log " \
"to the clipboard? (Crash logs will still be saved to the " \
"%appdata%\\obs-studio\\crashes directory)"
"to the clipboard? The crash log will still be saved to:\n\n%s"
static
void
main_crash_handler
(
const
char
*
format
,
va_list
args
,
void
*
param
)
{
...
...
@@ -1898,10 +1898,12 @@ static void main_crash_handler(const char *format, va_list args, void *param)
vsnprintf
(
text
,
MAX_CRASH_REPORT_SIZE
,
format
,
args
);
text
[
MAX_CRASH_REPORT_SIZE
-
1
]
=
0
;
delete_oldest_file
(
true
,
"obs-studio/crashes"
)
;
string
crashFilePath
=
"obs-studio/crashes"
;
string
name
=
"obs-studio/crashes/Crash "
;
name
+=
GenerateTimeDateFilename
(
"txt"
);
delete_oldest_file
(
true
,
crashFilePath
.
c_str
());
string
name
=
crashFilePath
+
"/"
;
name
+=
"Crash "
+
GenerateTimeDateFilename
(
"txt"
);
BPtr
<
char
>
path
(
GetConfigPathPtr
(
name
.
c_str
()));
...
...
@@ -1919,7 +1921,26 @@ static void main_crash_handler(const char *format, va_list args, void *param)
file
<<
text
;
file
.
close
();
int
ret
=
MessageBoxA
(
NULL
,
CRASH_MESSAGE
,
"OBS has crashed!"
,
string
pathString
(
path
.
Get
());
#ifdef _WIN32
std
::
replace
(
pathString
.
begin
(),
pathString
.
end
(),
'/'
,
'\\'
);
#endif
string
absolutePath
=
canonical
(
filesystem
::
path
(
pathString
)).
u8string
();
size_t
size
=
snprintf
(
nullptr
,
0
,
CRASH_MESSAGE
,
absolutePath
.
c_str
());
unique_ptr
<
char
[]
>
message_buffer
(
new
char
[
size
+
1
]);
snprintf
(
message_buffer
.
get
(),
size
+
1
,
CRASH_MESSAGE
,
absolutePath
.
c_str
());
string
finalMessage
=
string
(
message_buffer
.
get
(),
message_buffer
.
get
()
+
size
);
int
ret
=
MessageBoxA
(
NULL
,
finalMessage
.
c_str
(),
"OBS has crashed!"
,
MB_YESNO
|
MB_ICONERROR
|
MB_TASKMODAL
);
if
(
ret
==
IDYES
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录