Window -> Layouts -> Choose some layout.
This will close your broken window and save you from needing to restart Unity.
Set your class to a ScriptableObject
public class NoteWidget : ScriptableObject
to call your object/class...
NoteWidget NoteWid = ScriptableObject.CreateInstance<NoteWidget>();
Also don't forget to unload unused assets...
And you can always try and see if Serializing will help.
For more info check out Unity's post on the matter.
In some cases, if you delete your objects from some sort of a manager, you will not want unity to destroy the objects until you are ready. If that is the case, you will need to flag your object to prevent Unity from destroying it between editor modes.
hideFlags = HideFlags.HideAndDontSave;
But remember to destroy your objects with ImmediateDestroy!
I would recommend putting your destroy events in EditorWindow.OnDestroy()
Here is really a good guide I have found on the topic.