'Perform actions before parent main window is closed'

def closing_plugin(self, cancelable=False):

    self.mainwindow_close = True
    for client in self.clients:
        client.shutdown()
        client.close()
    return True
