possible pointer leak here: when is the MacDocIconHandler freed? Does its scope extend beyond that of the main window? If so, you should do setMainWindow(NULL) in the destructor.