My previous answer was not accurate. The nodes, like any other objects, will be destroyed when they are not referenced any more.
In almost all cases you should not be bothered about it. When you load the new layout the variables will point to the new nodes and the old ones will be destroyed.
You can use a class to manage the form. Then when you close the form you can remove the class instance reference and all the class objects will be released.