Tweak gresource initialization.
This commit is contained in:
parent
c92e40e3cf
commit
13751e3708
@ -6,11 +6,8 @@ pub fn init() -> Result<(), Error> {
|
|||||||
let res_bytes = include_bytes!("../resources/resources.gresource");
|
let res_bytes = include_bytes!("../resources/resources.gresource");
|
||||||
|
|
||||||
// Create Resource it will live as long the value lives.
|
// Create Resource it will live as long the value lives.
|
||||||
// TODO: change it into Bytes::From_static once the fix lands
|
let gbytes = Bytes::from_static(res_bytes.as_ref());
|
||||||
// https://bugzilla.gnome.org/show_bug.cgi?id=790030
|
|
||||||
let gbytes = Bytes::from(&res_bytes.as_ref());
|
|
||||||
let resource = Resource::new_from_data(&gbytes)?;
|
let resource = Resource::new_from_data(&gbytes)?;
|
||||||
// let resource = Resource::new_from_data(&res_bytes.as_ref().into())?;
|
|
||||||
|
|
||||||
// Register the resource so It wont be dropped and will continue to live in memory.
|
// Register the resource so It wont be dropped and will continue to live in memory.
|
||||||
resources_register(&resource);
|
resources_register(&resource);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user