mirror of
https://github.com/zlgopen/awtk.git
synced 2025-05-09 03:51:08 +08:00
fix memory leak
This commit is contained in:
parent
1d2bee2486
commit
f5ebf4b44c
@ -735,8 +735,6 @@ static ret_t slide_indicator_target_on_destroy(void* ctx, event_t* e) {
|
||||
return_value_if_fail(slide_indicator != NULL, RET_BAD_PARAMS);
|
||||
|
||||
slide_indicator->indicated_widget = NULL;
|
||||
TKMEM_FREE(slide_indicator->anchor_x);
|
||||
TKMEM_FREE(slide_indicator->anchor_y);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
@ -835,6 +833,8 @@ ret_t slide_indicator_on_destroy(widget_t* widget) {
|
||||
|
||||
slide_indicator_reset_indicated_widget(widget);
|
||||
TKMEM_FREE(slide_indicator->indicated_target);
|
||||
TKMEM_FREE(slide_indicator->anchor_x);
|
||||
TKMEM_FREE(slide_indicator->anchor_y);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
@ -140,5 +140,5 @@ TEST(SlideIndicator, props) {
|
||||
ASSERT_EQ(widget_set_prop_str(w, WIDGET_PROP_ANCHOR_Y, "100px"), RET_OK);
|
||||
ASSERT_STREQ(widget_get_prop_str(w, WIDGET_PROP_ANCHOR_Y, NULL), "100px");
|
||||
|
||||
widget_destroy(w);
|
||||
widget_destroy_sync(w);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user