mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Add an assert to opts::set_opts.
This function leaks if called more than once.
This commit is contained in:
parent
17747ad0e2
commit
8975a3bd9b
1 changed files with 1 additions and 0 deletions
|
@ -425,6 +425,7 @@ static mut OPTIONS: *mut Opts = 0 as *mut Opts;
|
|||
|
||||
pub fn set_opts(opts: Opts) {
|
||||
unsafe {
|
||||
assert!(OPTIONS.is_null());
|
||||
let box_opts = box opts;
|
||||
OPTIONS = mem::transmute(box_opts);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue