Correct way of freeing values in AutoHashMap

Is this the right way to free the values and the hashmap itself of a AutoHashMap?
(where the values are structs which need deinitialization, the key is a simple u8).

    var it = hash.valueIterator();
    while (it.next()) |value|
    {
        value.deinit();
    }
    hash.deinit();

Looks good to me.

It is correct.
A better version is using |*value| to get a pointer to value instead of a value copy.

Yes I did that. I thought that would be better. Thanks. You were earlier than me mentioning that.