Ticket #643 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Totally double-protect Layer class

Reported by: euzuro Owned by:
Priority: major Milestone: 2.4 Release
Component: Layer Version: 2.4 RC1
Keywords: Cc:
State:

Description

See #636 for more info, but the basic idea is that sometimes a layer will be a subclass of two different parent layers. then, at each step of the game, the correct way to deal with bubbling up calls to the superclass is to bubble them up to *both* superclasses. Unfortunately, as this plays itself out, that means that stuff here in layer will be getting called twice. No reason to put ourselves out so.

I realize this isn't the most elegant thing, but it's the only way I see proper to do it.

Attachments

layer.patch Download (4.7 KB) - added by euzuro 6 years ago.
for each function that might get double-called due to split subclassing, make a test condition to check if it's already been done before. most important of these is in the initialize() function.
layer2.patch Download (4.7 KB) - added by euzuro 6 years ago.
updated changes to constructor to follow tschaub's advice. makes it a bit more readable. thx!

Change History

Changed 6 years ago by euzuro

for each function that might get double-called due to split subclassing, make a test condition to check if it's already been done before. most important of these is in the initialize() function.

Changed 6 years ago by tschaub

can't initialize just have one condition: if(this.id == null) {} ?

Changed 6 years ago by euzuro

updated changes to constructor to follow tschaub's advice. makes it a bit more readable. thx!

Changed 6 years ago by crschmidt

  • keywords commit added; review removed

Please commit, and mark pullup.

Changed 6 years ago by euzuro

  • keywords pullup added; commit removed

Changed 6 years ago by crschmidt

  • keywords pullup removed
  • status changed from new to closed
  • resolution set to fixed

Brought up to 2.4 branch for RC2 with r3088

Note: See TracTickets for help on using tickets.