Skip to content

Commit

Permalink
embedding: cef_string_list_clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Blumenkrantz committed Oct 15, 2014
1 parent 9e5b240 commit 866483f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ports/cef/string_list.rs
Expand Up @@ -48,3 +48,17 @@ extern "C" fn cef_string_list_value(lt: *mut cef_string_list_t, index: c_int, va
cef_string_utf8_set(mem::transmute((**cs).str), (**cs).length, value, 1)
}
}

#[no_mangle]
extern "C" fn cef_string_list_clear(lt: *mut cef_string_list_t) {
unsafe {
if fptr_is_null(mem::transmute(lt)) { return; }
let mut v: Box<Vec<*mut cef_string_t>> = mem::transmute(lt);
if v.len() == 0 { return; }
let mut cs;
while v.len() != 0 {
cs = v.pop();
cef_string_userfree_utf8_free(cs.unwrap());
}
}
}

0 comments on commit 866483f

Please sign in to comment.