mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-30 03:10:29 -07:00
FIX: [5451]Directly crash when memory is low
Jira: 5451 Change-Id: I5c75994e2bd556bec7ce8de6be44888e6924ff56
This commit is contained in:
parent
b554f86675
commit
82fcd8122d
1 changed files with 2 additions and 9 deletions
|
|
@ -5520,15 +5520,8 @@ extern "C" {
|
|||
SET_DEFULTER_HANDLER();
|
||||
#endif
|
||||
std::set_new_handler([]() {
|
||||
int smallSize = 10 * 1024 * 1024;
|
||||
int *test_apply = (int *) malloc(smallSize);
|
||||
if (test_apply == NULL) {
|
||||
throw std::bad_alloc();
|
||||
} else {
|
||||
free(test_apply);
|
||||
int *a = nullptr;
|
||||
*a = 0;
|
||||
}
|
||||
int *a = nullptr;
|
||||
*a = 0;
|
||||
});
|
||||
// Call the UTF8 main.
|
||||
return CLI().run(argc, argv_ptrs.data());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue