mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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) {
|
pub fn set_opts(opts: Opts) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
assert!(OPTIONS.is_null());
|
||||||
let box_opts = box opts;
|
let box_opts = box opts;
|
||||||
OPTIONS = mem::transmute(box_opts);
|
OPTIONS = mem::transmute(box_opts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue