Menu

#2 mpWindow::AddLayer() sometimes overwrites layers

closed-fixed
cdron77
None
4
2008-08-07
2007-12-03
No

This happens after a layer that is not the "last" (the layer with largest key in the hashmap) is deleted. Although the layer does get deleted, the remaining mappings in the hashmap are not rearranged so that the "hole" in the key sequence is closed.
mpWindow::AddLayer() will then replace the last layer with the layer passed as argument, since the "key" returned by m_layers.size() is already mapped to a layer.

Example: a plot initially with four layers

Key 0 -> layer A
Key 1 -> layer B
Key 2 -> layer C
Key 3 -> layer D

After removing layer C and the mappings are:

Key 0 -> layer A
Key 1 -> layer B
Key 3 -> layer D

If a new layer is added, it will overwrite the last mapping since m_layers.size() will return 3.

Discussion

  • cdron77

    cdron77 - 2008-06-03
    • priority: 5 --> 4
    • assigned_to: nobody --> cdron77
     
  • cdron77

    cdron77 - 2008-08-07
    • status: open --> closed-fixed
     
  • cdron77

    cdron77 - 2008-08-07

    Logged In: YES
    user_id=1669489
    Originator: NO

    Fixed in Subversion development code. m_layers has become a std::deque of mpLayer pointers in the meanwhile.

     

Log in to post a comment.

MongoDB Logo MongoDB