Re: python bindings GInitiallyUnowned issue



Am 28.07.2010 22:08, schrieb Ranen Ghosh:
Hello, I find that calling ChamplainView object's set_map_source() with the result of champlain.file_cache_new_full() in python leads to errors..

        self.tilecache = champlain.file_cache_new_full( 1,
                                     '/home/rghosh/shared/test/jepp_osm',
                                     True )

        print "ref count 1", sys.getrefcount(self.tilecache)
        sys.stdout.flush()
        view.set_map_source( self.tilecache )
        print "ref count 2", sys.getrefcount(self.tilecache)

output:

ref count 1 2

** (cluttertest.py:25857): CRITICAL **: get_min_zoom_level: assertion `CHAMPLAIN_IS_MAP_SOURCE (next_source)' failed

** (cluttertest.py:25857): CRITICAL **: get_max_zoom_level: assertion `CHAMPLAIN_IS_MAP_SOURCE (next_source)' failed

** (cluttertest.py:25857): CRITICAL **: get_license: assertion `CHAMPLAIN_IS_MAP_SOURCE (next_source)' failed

** (cluttertest.py:25857): CRITICAL **: get_tile_size: assertion `CHAMPLAIN_IS_MAP_SOURCE (next_source)' failed

** (cluttertest.py:25857): CRITICAL **: get_tile_size: assertion `CHAMPLAIN_IS_MAP_SOURCE (next_source)' failed

** (cluttertest.py:25857): CRITICAL **: get_tile_size: assertion `CHAMPLAIN_IS_MAP_SOURCE (next_source)' failed
ref count 2 2

I wonder if it's due to reference count issues in the python bindings, since ChamplainFileCache inherits from GInitiallyUnowned ?

Ranen
Hi,
you should add the file_cache to a champlain.MapSourceChain(), that works fine for me.

Example:
        self.source = self.map_source_factory.create("memphis-local")

        tile_size = self.source.get_tile_size()
        error_tile_source = champlain.error_tile_source_new_full(tile_size)

file_cache = champlain.file_cache_new_full(size, file_cache_path, True)

        source_chain = champlain.MapSourceChain()
        source_chain.push(error_tile_source)
        source_chain.push(self.source)
        source_chain.push(file_cache)
        self.view.set_map_source(source_chain)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]