[bug] NppParameters need to truly behave as a singleton
Reported by Jocelyn Legault | December 4th, 2009 @ 09:44 PM | in v2.0.0
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.
Comments and changes to this ticket
-
Jocelyn Legault December 4th, 2009 @ 10:01 PM
(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 thegetInstance()
is). - Non-static data that was destroyed in the
destroyInstance()
method is now destroyed in the destructor.
[#26 state:needs_ack responsible:npp-community]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/joce/npp-community/commit/6b811a74301ed0b751481ea... -
Jocelyn Legault December 5th, 2009 @ 07:15 PM
(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 thegetInstance()
is). - Non-static data that was destroyed in the
destroyInstance()
method is now destroyed in the destructor.
[#26 state:needs_ack responsible:npp-community]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/joce/npp-community/commit/b3014bc5379b45a6f1531db... -
Thell Fowler December 6th, 2009 @ 10:20 PM
- 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.
-
Thell Fowler December 7th, 2009 @ 06:14 AM
- 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 state:proposed]
Acked-by: Thell Fowler git@tbfowler.name
http://github.com/npp-community/npp-community/commit/41f02ef31f2c4a... -
Thell Fowler December 7th, 2009 @ 11:15 PM
(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 state:proposed]
Acked-by: Thell Fowler git@tbfowler.name
http://github.com/npp-community/npp-community/commit/9a99063417f49b... -
Jocelyn Legault December 8th, 2009 @ 03:08 AM
(from [855fadd2506cf22853c1c13cb88424b89aaafc76]) FileManager: Make a real singleton.
- Did the same surgery on FileManager as I did on Parameters and WcharMbcsConvertor.
- This also fixes LH ticket #3
[#26]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/joce/npp-community/commit/855fadd2506cf22853c1c13... -
Thell Fowler December 10th, 2009 @ 10:01 PM
- State changed from proposed to acked
Thanks joce!
This will be updated on pu asap.
-
npp-community December 12th, 2009 @ 04:24 PM
(from [55d585a52cd2a67568191a7d69d14ceabd0a4bc6]) FileManager: Make a real singleton.
- Did the same surgery on FileManager as I did on Parameters and WcharMbcsConvertor.
- This also fixes LH ticket #3
[#26]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/npp-community/npp-community/commit/55d585a52cd2a6... -
Thell Fowler December 12th, 2009 @ 04:26 PM
- State changed from acked to proposed
-
Jocelyn Legault December 14th, 2009 @ 05:08 PM
- Milestone set to v2.0.0
-
Thell Fowler December 22nd, 2009 @ 03:53 PM
(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]
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/almostautomated/npp-community/commit/ea66473d74e7... -
Thell Fowler January 19th, 2010 @ 12:02 AM
(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]
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/npp-community/npp-community/commit/b26cbf7e8a2ee3... -
Thell Fowler January 19th, 2010 @ 12:09 AM
- State changed from proposed to resolved
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Notepad++ Community Release
People watching this ticket
Referenced by
- 26 [bug] NppParameters need to truly behave as a singleton [#26 state:needs_ack responsible:npp-community]
- 26 [bug] NppParameters need to truly behave as a singleton [#26 state:needs_ack responsible:npp-community]
- 26 [bug] NppParameters need to truly behave as a singleton [#26 state:proposed]
- 26 [bug] NppParameters need to truly behave as a singleton [#26 state:proposed]
- 26 [bug] NppParameters need to truly behave as a singleton [#26]
- 3 [Memory leak] Leak when running unit tests This ticket was rendered invalid by a commit for ticket #...
- 26 [bug] NppParameters need to truly behave as a singleton [#26]
- 26 [bug] NppParameters need to truly behave as a singleton [#26]
- 26 [bug] NppParameters need to truly behave as a singleton [#26]