swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 24d8954d9b2a06af540a908b7a61f64c90ee3c83
parent d603a266d20665aa2aba9f2df94cdbaa0ba3292e
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 26 Feb 2014 18:56:03 -0800

data: Set empty offer destructor after source is destroyed

This way we don't attempt to access the freed source link when removing
the offer link.

Diffstat:
Mlibswc/data.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libswc/data.c b/libswc/data.c @@ -1,6 +1,6 @@ /* swc: data.c * - * Copyright (c) 2013 Michael Forney + * Copyright (c) 2013, 2014 Michael Forney * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -116,7 +116,10 @@ static void data_destroy(struct wl_resource * source) * * So, we clear the user data on each of the offers to protect us. */ wl_resource_for_each(offer, &data->offers) + { wl_resource_set_user_data(offer, NULL); + wl_resource_set_destructor(offer, NULL); + } free(data); }