Qt embedding problem

Hi there,
I have problem with embedding MPL into my application.
Fo example:
############################################################## qtemb.py file
import matplotlib
matplotlib.use('Agg') # need to set before importing pylab

from sys import argv,exit
from pylab import *

from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure

from qt import *

a = QApplication(argv)
w = QWidget()

figure(1)
subplot(111)
plot([1,2,3], [0.2, 2.1, 1.1])

canvas = FigureCanvas(gcf())
canvas.reparent(w, QPoint(0, 0))

l = QVBoxLayout(w)
l.addWidget(canvas)

a.setMainWidget(w)

w.show()
exit(a.exec_loop())
############################################################## qtemb.py file

I have problems with running qtemb.py-it reports:

QApplication: There should be max one application object

and it is impossible to close window (simply freezes).

FIX:
When comment out last lines in backends/backend_qt.py:

#createQApp = qt.QApplication.startingUp()
#if createQApp:
# if DEBUG: print "Starting up QApplication"
# qtapplication = qt.QApplication( [" "] )

it works fine.

So, I my opinion, it needs different QApplication running instance check.
What do you think about it?

Regards
Jiri