Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

MGLSource and MGLLayer should raise an NSException if they are added to the style more than once #7271

Closed

Description

@boundsj

When MGLSource and MGLLayer instances are added to the style, they lose ownership of their std::unique_ptr<T> after it is moved to the mbgl level. Subsequent attempts to add such instances will result in a C++ exception.

An NSException should be raised if the source and layer addToMapView methods are called more than once and the pointer is invalid. In addition, the documentation in MGLStyle for addSource: and addLayer: should warn developers to avoid adding the same instance twice and, for that matter, instances with the same identifier.

Activity

  1. added
    iOS
    macOS
    on Dec 2, 2016
  2. added this to the ios-v3.4.0 milestone on Dec 2, 2016
  3. self-assigned this
    on Dec 2, 2016
  4. boundsj commented on Dec 2, 2016

    @boundsj
    ContributorAuthor

    ref #7258

  5. boundsj commented on Dec 2, 2016

    @boundsj
    ContributorAuthor

    Fixed in #7272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationiOSmacOSruntime styling

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions