[PyQt] [PyQtMobility] QGeoServiceProvider factory methods

Phil Thompson phil at riverbankcomputing.com
Sat Mar 12 12:02:13 GMT 2011

On Fri, 11 Mar 2011 19:05:00 +0100, David Boddie <david at boddie.org.uk>
> I've been looking at using Qt Mobility 1.1 (or thereabouts) with
> PyQtMobility
> 0.2 and I encountered an issue with the
> QGeoServiceProvider.mappingManager()
> factory method. It seems that the documented behaviour of the method
> conflicts with the bindings for that class in which the method is
> with the /Factory/ annotation.
> The documentation says this:
>   This function will attempt to construct a QGeoMappingManager instance
>   when it is called for the first time.  If the attempt is successful
>   QGeoMappingManager will be cached, otherwise each call of this
>   will attempt to construct a QGeoMappingManager instance until the
>   construction is successful.
> The result is that, if I call this method to obtain a
> Python gets ownership of it. So, if I let it go out of scope, the
> underlying
> object is destroyed, and calling the method again will result in a
> segfault.
> I imagine the problem also exists for the routingManager() and
> searchManager() methods.

Fixed in the current snapshot.


More information about the PyQt mailing list