X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..90556fb8d47e7b68fd301dde9dbb3ae7495cf323:/osfmk/kern/task.c diff --git a/osfmk/kern/task.c b/osfmk/kern/task.c index ea12d7b39..2621419f9 100644 --- a/osfmk/kern/task.c +++ b/osfmk/kern/task.c @@ -510,6 +510,10 @@ task_deallocate( assert((task->swap_state & TASK_SW_ELIGIBLE) == 0); #endif /* TASK_SWAPPER */ + if(task->dynamic_working_set) + tws_hash_destroy((tws_hash_t)task->dynamic_working_set); + + eml_task_deallocate(task); ipc_task_terminate(task); @@ -708,8 +712,12 @@ task_terminate_internal( shared_region_mapping_dealloc(task->system_shared_region); + /* + * Flush working set here to avoid I/O in reaper thread + */ if(task->dynamic_working_set) - tws_hash_destroy((tws_hash_t)task->dynamic_working_set); + tws_hash_ws_flush((tws_hash_t) + task->dynamic_working_set); /* * We no longer need to guard against being aborted, so restore