[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>
wrote:
> 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
annotated
> 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
the
>   QGeoMappingManager will be cached, otherwise each call of this
function
>   will attempt to construct a QGeoMappingManager instance until the
>   construction is successful.
> 
> The result is that, if I call this method to obtain a
QGeoMappingManager,
> 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.

Thanks,
Phil


More information about the PyQt mailing list