Skip to content

QGIS crashes on registering a Custom Profile Source with 'Sync Layers to Project' active #65056

@gacarrillor

Description

@gacarrillor

What is the bug or the crash?

QGIS crashes when a custom profile source is registered with the "Synchronize Layers to Project" active.

Custom Profile Sources can be registered by plugins, like Swiss Locator.

Steps to reproduce the issue

  1. Open QGIS (current master, 3.99) and open an Elevation profile widget.
  2. Check the Synchronize Layers to Project option.
  3. Register a custom profile source. E.g., run the following code snippet:
class MyDummyProfileGenerator(QgsAbstractProfileGenerator):
    def __init__(self, request):
        QgsAbstractProfileGenerator.__init__(self)

    def sourceId(self):
        return "my-dummy-profile"

    def generateProfile(self, context):
        return True

    def takeResults(self):
        return None
        
class MyDummyProfileSource(QgsAbstractProfileSource):
    def __init__(self):
        QgsAbstractProfileSource.__init__(self)

    def createProfileGenerator(self, request):
        return MyDummyProfileGenerator(request)

    def profileSourceName(self):
        return "My Dummy Profile"

    def profileSourceId(self):
        return "my-dummy-profile"
        
source = MyDummyProfileSource()
QgsApplication.profileSourceRegistry().registerProfileSource(source)

The expected result would be this new Elevation profile source in the Elevation layer tree:

Image

Versions

QGIS version3.99.0-Master
QGIS code revisionf937ebdfd0b
 
Libraries
Qt version6.9.2
Python version3.13.7
GDAL version3.10.3
PROJ version9.6.0
EPSG Registry database versionv12.004 (2025-03-02)
GEOS version3.13.1-CAPI-1.19.2
SFCGAL versionNo support
GeographicLib versionNo support
SQLite version3.46.1
PostgreSQL client version17.7
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionUbuntu 25.10
This copy of QGIS writes debugging output.
 
Active Python plugins
AppendFeaturesToLayer3.0.0
MetaSearch0.3.6
a00_qpipdev
db_manager0.1.20
grassprovider2.12.99
open_alaqsdev
pg_service_parser0.9.0
processing2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions