Add destroy function for dialog component.

Signed-off-by: Kurtis Liu <liukai545x@sina.com>