mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Ensure render and layout tasks get destructed before main thread finishes
Fixes #1097.
This commit is contained in:
parent
44404766da
commit
e7a591a7e1
9 changed files with 146 additions and 90 deletions
|
@ -207,18 +207,23 @@ impl LayoutTask {
|
|||
render_chan: RenderChan<AbstractNode<()>>,
|
||||
img_cache_task: ImageCacheTask,
|
||||
opts: Opts,
|
||||
profiler_chan: ProfilerChan) {
|
||||
profiler_chan: ProfilerChan,
|
||||
shutdown_chan: Chan<()>) {
|
||||
spawn_with!(task::task(), [port, constellation_chan, script_chan,
|
||||
render_chan, img_cache_task, profiler_chan], {
|
||||
let mut layout = LayoutTask::new(id,
|
||||
port,
|
||||
constellation_chan,
|
||||
script_chan,
|
||||
render_chan,
|
||||
img_cache_task,
|
||||
&opts,
|
||||
profiler_chan);
|
||||
layout.start();
|
||||
render_chan, img_cache_task, profiler_chan, shutdown_chan], {
|
||||
{ // Ensures LayoutTask gets destroyed before we send the shutdown message
|
||||
let mut layout = LayoutTask::new(id,
|
||||
port,
|
||||
constellation_chan,
|
||||
script_chan,
|
||||
render_chan,
|
||||
img_cache_task,
|
||||
&opts,
|
||||
profiler_chan);
|
||||
layout.start();
|
||||
}
|
||||
|
||||
shutdown_chan.send(());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue