'DEPRECATED since IPython 5.0
Clear IPython\'s internal reference to an application instance.
Whenever we create an app for a user on qt4 or wx, we hold a
reference to the app.  This is needed because in some cases bad things
can happen if a user doesn\'t hold a reference themselves.  This
method is provided to clear the references we are holding.
Parameters
gui : None or str
If None, clear all app references.  If (\'wx\', \'qt4\') clear
the app for that toolkit.  References are not held for gtk or tk
as those toolkits don\'t have the notion of an app.'

def clear_app_refs(self, gui=None):

    warn('`clear_app_refs`    is    deprecated    since    IPython    5.0    and    will    be    removed    in    future    versions.', DeprecationWarning, stacklevel=2)
    if (gui is None):
        self.apps = {}
    elif (gui in self.apps):
        del self.apps[gui]
