Skip to content

Commit 2aab1df

Browse files
Lord-McSweeneyLord-McSweeney
Lord-McSweeney
authored andcommitted
core: Don't pass static string to Avm1Button::get_boolean_property
1 parent 535bbb0 commit 2aab1df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/src/display_object/avm1_button.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ use crate::display_object::interactive::{
1212
use crate::display_object::{DisplayObjectBase, DisplayObjectPtr};
1313
use crate::events::{ClipEvent, ClipEventResult};
1414
use crate::prelude::*;
15+
use crate::string::AvmString;
1516
use crate::tag_utils::{SwfMovie, SwfSlice};
1617
use crate::vminterface::Instantiator;
1718
use core::fmt;
1819
use gc_arena::barrier::unlock;
1920
use gc_arena::lock::{Lock, RefLock};
2021
use gc_arena::{Collect, Gc, Mutation};
22+
use ruffle_macros::istr;
2123
use ruffle_render::filters::Filter;
2224
use std::cell::{Cell, Ref, RefCell, RefMut};
2325
use std::collections::BTreeMap;
@@ -207,9 +209,9 @@ impl<'gc> Avm1Button<'gc> {
207209

208210
fn get_boolean_property(
209211
self,
210-
context: &mut UpdateContext<'gc>,
211-
name: &'static str,
212+
name: AvmString<'gc>,
212213
default: bool,
214+
context: &mut UpdateContext<'gc>,
213215
) -> bool {
214216
if let Value::Object(object) = self.object() {
215217
let mut activation = Activation::from_nothing(
@@ -231,11 +233,11 @@ impl<'gc> Avm1Button<'gc> {
231233
}
232234

233235
fn enabled(self, context: &mut UpdateContext<'gc>) -> bool {
234-
self.get_boolean_property(context, "enabled", true)
236+
self.get_boolean_property(istr!(context, "enabled"), true, context)
235237
}
236238

237239
fn use_hand_cursor(self, context: &mut UpdateContext<'gc>) -> bool {
238-
self.get_boolean_property(context, "useHandCursor", true)
240+
self.get_boolean_property(istr!(context, "useHandCursor"), true, context)
239241
}
240242
}
241243

0 commit comments

Comments
 (0)