dialog content hidden after destroy - issue

dialog content hidden after destroy - issue


Hello,
I am designing a generic dialog that is supposed to handle dynamic
content. I came up with the code (simplified) :
$("#dialog").dialog("destroy");
$("#dialog").dialog({
autoOpen: true,
}).load('something.php', data);
The issue is after running the code for the second time the content of
the dialog is just hidden. All other attributes changes accordingly to
the new options (title, size etc.). Finally I could find an ugly hack
to past around this:
$("#dialog").dialog("destroy");
$("#dialog").dialog({
autoOpen: true,
}).load('something.php', data).show();
Is this expected behavior or a bug ?