We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The initialization of ServoMedia is very much unsound and should just be using lazy_static.
ServoMedia
lazy_static
This is INSTANCE, note how it is initialized as a raw null pointer (that should be using std::ptr::null_mut() btw):
INSTANCE
std::ptr::null_mut()
media/servo-media/lib.rs
Line 25 in a70f024
Those are the three methods handling initialization:
Lines 68 to 90 in a70f024
Note how calling ServoMedia::get() before ServoMedia::init() or ServoMedia::init_with_backend(backend) will dereference a null pointer.
ServoMedia::get()
ServoMedia::init()
ServoMedia::init_with_backend(backend)
Please use lazy_static instead of manually using Once and a raw pointer in a static.
Once
The text was updated successfully, but these errors were encountered:
The raw pointer and Once value was previously soundly used but it was broken when the method init was introduced.
init
Sorry, something went wrong.
How does one pass Box<dyn Backend> into lazy_static block?
Box<dyn Backend>
#335
No branches or pull requests
The initialization of
ServoMedia
is very much unsound and should just be usinglazy_static
.This is
INSTANCE
, note how it is initialized as a raw null pointer (that should be usingstd::ptr::null_mut()
btw):media/servo-media/lib.rs
Line 25 in a70f024
Those are the three methods handling initialization:
media/servo-media/lib.rs
Lines 68 to 90 in a70f024
Note how calling
ServoMedia::get()
beforeServoMedia::init()
orServoMedia::init_with_backend(backend)
will dereference a null pointer.Please use
lazy_static
instead of manually usingOnce
and a raw pointer in a static.The text was updated successfully, but these errors were encountered: