Set the stack size of the main thread to 8M (#227)
For fix stack overflow issue on Windows.
This commit is contained in:
parent
821487bed5
commit
2f80ba408a
1 changed files with 38 additions and 32 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
use std::sync::Arc;
|
use std::{sync::Arc, thread};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use app_state::AppState;
|
use app_state::AppState;
|
||||||
|
|
@ -21,6 +21,9 @@ fn init(app_state: Arc<AppState>, cx: &mut AppContext) -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let join_handle = thread::Builder::new()
|
||||||
|
.stack_size(8 * 1024 * 1024) // Set the stack size to 8MB
|
||||||
|
.spawn(|| {
|
||||||
let app_state = Arc::new(AppState {});
|
let app_state = Arc::new(AppState {});
|
||||||
|
|
||||||
let app = App::new().with_assets(Assets);
|
let app = App::new().with_assets(Assets);
|
||||||
|
|
@ -59,6 +62,9 @@ fn main() {
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.unwrap();
|
||||||
|
join_handle.join().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn quit(_: &Quit, cx: &mut AppContext) {
|
fn quit(_: &Quit, cx: &mut AppContext) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue