mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Don't use mem::uninitialized() for making calc values
We had code relying on `nsStyleCoord::set()` being leaky (like it was before we patched up the calc bindings). Added `nsStyleCoord::null()` for this use case since it's not possible to construct directly anymore.
This commit is contained in:
parent
78baf21c54
commit
5ec2226f5b
2 changed files with 13 additions and 2 deletions
|
@ -35,7 +35,7 @@ use logical_geometry::WritingMode;
|
|||
use properties::CascadePropertyFn;
|
||||
use properties::longhands;
|
||||
use std::fmt::{self, Debug};
|
||||
use std::mem::{transmute, uninitialized, zeroed};
|
||||
use std::mem::{transmute, zeroed};
|
||||
use std::ptr;
|
||||
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
@ -1133,7 +1133,7 @@ fn static_assert() {
|
|||
}
|
||||
}
|
||||
|
||||
let mut coord: nsStyleCoord = unsafe { uninitialized() };
|
||||
let mut coord: nsStyleCoord = nsStyleCoord::null();
|
||||
for (index, stop) in gradient.stops.iter().enumerate() {
|
||||
// NB: stops are guaranteed to be none in the gecko side by
|
||||
// default.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue