[librsvg] CHandle: restore the check for only setting the base_url before loading
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] CHandle: restore the check for only setting the base_url before loading
- Date: Fri, 12 Apr 2019 16:46:49 +0000 (UTC)
commit c13672605613a5c34878ee12d711023f529852d2
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Apr 12 11:44:43 2019 -0500
CHandle: restore the check for only setting the base_url before loading
rsvg_internals/src/c_api.rs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/c_api.rs b/rsvg_internals/src/c_api.rs
index 2a7711d6..f9f6a73b 100644
--- a/rsvg_internals/src/c_api.rs
+++ b/rsvg_internals/src/c_api.rs
@@ -476,9 +476,12 @@ impl ObjectImpl for CHandle {
impl CHandle {
fn set_base_url(&self, url: &str) {
- // if self.load_state.get() != LoadState::Start {
- // panic!("Please set the base file or URI before loading any data into RsvgHandle",);
- // }
+ let mut state = self.load_state.borrow();
+
+ match *state {
+ LoadState::Start => (),
+ _ => panic!("Please set the base file or URI before loading any data into RsvgHandle",),
+ }
match Url::parse(&url) {
Ok(u) => {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]