Skip to content

Commit 4ada9bc

Browse files
committed
Revert "select: autogenerator: No need to NULL guard lwc_string_unref"
This reverts commit c812359.
1 parent 91d1c18 commit 4ada9bc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/select/autogenerated_propset.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ static inline css_error set_background_image(css_computed_style *style, uint8_t
127127
style->i.background_image = NULL;
128128
}
129129

130-
lwc_string_unref(old_string);
130+
if (old_string != NULL)
131+
lwc_string_unref(old_string);
131132

132133
return CSS_OK;
133134
}
@@ -1439,7 +1440,8 @@ static inline css_error set_list_style_image(css_computed_style *style, uint8_t
14391440
style->i.list_style_image = NULL;
14401441
}
14411442

1442-
lwc_string_unref(old_string);
1443+
if (old_string != NULL)
1444+
lwc_string_unref(old_string);
14431445

14441446
return CSS_OK;
14451447
}

src/select/select_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,10 @@ def make_propset_h(self):
588588
t.indent(-1)
589589
t.append('}')
590590
t.append()
591+
t.append('if ({} != NULL)'.format(old_n))
592+
t.indent(1)
591593
t.append('lwc_string_unref({});'.format(old_n))
594+
t.indent(-1)
592595

593596
elif v.name == 'string_arr' or v.name == 'counter_arr':
594597
iter_var = 's' if v.name == 'string_arr' else 'c'

0 commit comments

Comments
 (0)