mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
various: use talloc_replace
This commit is contained in:
@@ -2028,8 +2028,7 @@ static void update_icc_opts(struct priv *p, const struct mp_icc_opts *opts)
|
||||
update_icc(p, icc);
|
||||
|
||||
// Update cached path
|
||||
talloc_free(p->icc_path);
|
||||
p->icc_path = talloc_strdup(p, opts->profile);
|
||||
talloc_replace(p, p->icc_path, opts->profile);
|
||||
}
|
||||
|
||||
static void update_lut(struct priv *p, struct user_lut *lut)
|
||||
@@ -2045,8 +2044,7 @@ static void update_lut(struct priv *p, struct user_lut *lut)
|
||||
|
||||
// Update cached path
|
||||
pl_lut_free(&lut->lut);
|
||||
talloc_free(lut->path);
|
||||
lut->path = talloc_strdup(p, lut->opt);
|
||||
talloc_replace(p, lut->path, lut->opt);
|
||||
|
||||
// Load LUT file
|
||||
char *fname = mp_get_user_path(NULL, p->global, lut->path);
|
||||
|
||||
@@ -655,9 +655,7 @@ static void data_offer_handle_offer(void *data, struct wl_data_offer *offer,
|
||||
int score = mp_event_get_mime_type_score(wl->vo->input_ctx, mime_type);
|
||||
if (score > wl->dnd_mime_score && wl->opts->drag_and_drop != -2) {
|
||||
wl->dnd_mime_score = score;
|
||||
if (wl->dnd_mime_type)
|
||||
talloc_free(wl->dnd_mime_type);
|
||||
wl->dnd_mime_type = talloc_strdup(wl, mime_type);
|
||||
talloc_replace(wl, wl->dnd_mime_type, mime_type);
|
||||
MP_VERBOSE(wl, "Given DND offer with mime type %s\n", wl->dnd_mime_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2229,8 +2229,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
|
||||
set_screensaver(x11, true);
|
||||
return VO_TRUE;
|
||||
case VOCTRL_UPDATE_WINDOW_TITLE:
|
||||
talloc_free(x11->window_title);
|
||||
x11->window_title = talloc_strdup(x11, (char *)arg);
|
||||
talloc_replace(x11, x11->window_title, (char *)arg);
|
||||
if (!x11->parent || x11->opts->x11_wid_title)
|
||||
vo_x11_update_window_title(vo);
|
||||
return VO_TRUE;
|
||||
|
||||
Reference in New Issue
Block a user