Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

[bug] NppParameters need to truly behave as a singleton

#26

NppParameters is kind of a singleton, but it's not totally behaving as such: - its instance isn't created upon the first access to it - there's no static destructor for the instance.

These two things need to be fixed, so NppParameters' instance will live within the life cycle of main() instead of at some random point before the main function is entered.

Note: Ideally, that would not be a singleton at all, but a member of an application object, but that's way beyond the scope of this bug report.

Reported by Jocelyn Legault · December 4th, 2009 @ 09:44 PM

State: resolved
Milestone: v2.0.0
Assigned to: npp-community npp-community

Activity

  1. Jocelyn Legault
    Jocelyn Legault

    (from [6b811a74301ed0b751481ea717f455a4855ce51e]) NppParameters: make it a true singleton.

    • The object is now created at the first request, and no longer as a global.
    • The destroyInstance() method is now static (as the getInstance() is).
    • Non-static data that was destroyed in the destroyInstance() method is now destroyed in the destructor.

    [#26 [bug] NppParameters need to truly behave as a singleton state:needs_ack responsible:npp-community]

    Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
    http://github.com/joce/npp-community/commit/6b811a74301ed0b751481ea...

    December 4th, 2009 @ 10:01 PM

  2. Jocelyn Legault
    Jocelyn Legault

    (from [b3014bc5379b45a6f1531db86b191b07f398ef35]) NppParameters: make it a true singleton.

    • The object is now created at the first request, and no longer as a global.
    • The destroyInstance() method is now static (as the getInstance() is).
    • Non-static data that was destroyed in the destroyInstance() method is now destroyed in the destructor.

    [#26 [bug] NppParameters need to truly behave as a singleton state:needs_ack responsible:npp-community]

    Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
    http://github.com/joce/npp-community/commit/b3014bc5379b45a6f1531db...

    December 5th, 2009 @ 07:15 PM

  3. Thell Fowler
    Thell Fowler
    • State changed from needs_ack to acked

    The name of this ticket needs to be changed.... although I haven't been able to figure out how yet...

    The branch name as presented on pu will be jl/LH-26/singleton-transformations.

    As you mention above these should not be true singletons, but part of an app object. In order to allow for proper debug output within certain classes this branch && ticket should be used when needed even if it is marked as resolved the new commit should be added to it and the state updated.

    December 6th, 2009 @ 10:20 PM

  4. Thell Fowler
    Thell Fowler
    • State changed from acked to proposed

    (from [41f02ef31f2c4ad2ff58381a65bac779c5a001d9]) Merge branch 'jl/LH-26/singleton-transformations' into pu

    • jl/LH-26/singleton-transformations: WcharMbcsConvertor: fix the singleton. NppParameters: make it a true singleton.

    [#26 [bug] NppParameters need to truly behave as a singleton state:proposed]

    Acked-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/41f02ef31f2c4a...

    December 7th, 2009 @ 06:14 AM

  5. Thell Fowler
    Thell Fowler

    (from [9a99063417f49bc4ab8230e655e8aadd9c216e0a]) Merge branch 'jl/LH-26/singleton-transformations' into pu

    • jl/LH-26/singleton-transformations: WcharMbcsConvertor: fix the singleton. NppParameters: make it a true singleton.

    [#26 [bug] NppParameters need to truly behave as a singleton state:proposed]

    Acked-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/9a99063417f49b...

    December 7th, 2009 @ 11:15 PM

  6. Jocelyn Legault
    Jocelyn Legault

    (from [855fadd2506cf22853c1c13cb88424b89aaafc76]) FileManager: Make a real singleton.

    [#26 [bug] NppParameters need to truly behave as a singleton]

    Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
    http://github.com/joce/npp-community/commit/855fadd2506cf22853c1c13...

    December 8th, 2009 @ 03:08 AM

  7. Thell Fowler
    Thell Fowler
    • State changed from proposed to acked

    Thanks joce!

    This will be updated on pu asap.

    December 10th, 2009 @ 10:01 PM

  8. npp-community
    npp-community

    (from [55d585a52cd2a67568191a7d69d14ceabd0a4bc6]) FileManager: Make a real singleton.

    [#26 [bug] NppParameters need to truly behave as a singleton]

    Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
    http://github.com/npp-community/npp-community/commit/55d585a52cd2a6...

    December 12th, 2009 @ 04:24 PM

  9. Thell Fowler
    Thell Fowler
    • State changed from acked to proposed

    December 12th, 2009 @ 04:26 PM

  10. Jocelyn Legault
  11. Thell Fowler
    Thell Fowler

    (from [ea66473d74e769de60e64b08749551061e5fb10f]) Merge branch 'jl/LH-26/singleton-transformations' into pu

    • jl/LH-26/singleton-transformations: FileManager: Make a real singleton. WcharMbcsConvertor: fix the singleton. NppParameters: make it a true singleton.

    Conflicts:

    PowerEditor/src/Parameters.cpp
    

    [#26 [bug] NppParameters need to truly behave as a singleton]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/ea66473d74e7...

    December 22nd, 2009 @ 03:53 PM

  12. Thell Fowler
    Thell Fowler

    (from [b26cbf7e8a2ee350abe296e8d91dee9feae2321b]) Merge branch 'jl/LH-26/singleton-transformations'

    • jl/LH-26/singleton-transformations: FileManager: Make a real singleton. WcharMbcsConvertor: fix the singleton. NppParameters: make it a true singleton.

    Conflicts:

    PowerEditor/src/Parameters.cpp
    

    [#26 [bug] NppParameters need to truly behave as a singleton]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/b26cbf7e8a2ee3...

    January 19th, 2010 @ 12:02 AM

  13. Thell Fowler
    Thell Fowler
    • State changed from proposed to resolved

    January 19th, 2010 @ 12:09 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.