Skip to content

Commit

Permalink
AvstpWrapper: try another singleton implementation
Browse files Browse the repository at this point in the history
Try to force VC to call the constructor earlier (i.e. at DLL load
time).

Updates #1.

Signed-off-by: akarin <[email protected]>
  • Loading branch information
AkarinVS committed May 22, 2021
1 parent b5fd4f2 commit ac42d7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/AvstpWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ Name: use_instance
==============================================================================
*/

AvstpWrapper AvstpWrapper::instance;
AvstpWrapper & AvstpWrapper::use_instance ()
{
static AvstpWrapper instance;

return (instance);
}

Expand Down
1 change: 1 addition & 0 deletions src/AvstpWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class AvstpWrapper
bool operator == (const AvstpWrapper &other) const;
bool operator != (const AvstpWrapper &other) const;

static AvstpWrapper instance;
}; // class AvstpWrapper


Expand Down

0 comments on commit ac42d7e

Please sign in to comment.