web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
10.05k stars 573 forks source link

fix: should not free native compiler while compiler is running #8437

Closed h-a-n-a closed 1 week ago

h-a-n-a commented 1 week ago

Summary

Fixed MultiCompiler test. Some cases tested scenarios where closing the compiler when it is still running. However in previous memory leak fix PR, we freed the native compiler when compiler.close is called. Thus, causing a segmentation fault.

To fix this issue, we need to add a compiler status check to free only if it's not running.

Checklist

netlify[bot] commented 1 week ago

Deploy Preview for rspack canceled.

Name Link
Latest commit bfb29d7ad6b40f2eb1fee6c6b3a96a0ff9d4ff41
Latest deploy log https://app.netlify.com/sites/rspack/deploys/6735b410f27c660008cdd8e9