Skip to content

Commit

Permalink
make used_ids a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Jul 11, 2016
1 parent b7787bb commit 9c06b57
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions templates/librarylink.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ struct Model_data {
typedef std::map<Handle_id, Model_data> Handle_map;
Handle_map handles;

/// used handle numbers
static Handle_id used_ids = 0;

/// mutex to lock global variables
std::mutex mtx;

Expand All @@ -148,6 +145,7 @@ std::mutex mtx;

Handle_id get_new_handle()
{
static Handle_id used_ids = 0;
LOCK_MUTEX();
return used_ids++;
}
Expand Down

0 comments on commit 9c06b57

Please sign in to comment.