diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-12-02 19:40:33 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-12-02 19:43:20 +0100 |
commit | eea9343393614f81169eaf9ac1fcab1db949d018 (patch) | |
tree | a9c71e85998d0fe532efbe8fdd1f2cd7104cb920 /src/base.cpp | |
parent | fd20068a0bddf39b7464218997ccff37489608c9 (diff) |
Throw an exception when attempting to register an extension with a name that already exists
Previously this silently failed
Diffstat (limited to 'src/base.cpp')
-rw-r--r-- | src/base.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base.cpp b/src/base.cpp index bf74d9dc2..66a3cb140 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -132,9 +132,9 @@ void* ExtensionItem::unset_raw(Extensible* container) return rv; } -void ExtensionManager::Register(ExtensionItem* item) +bool ExtensionManager::Register(ExtensionItem* item) { - types.insert(std::make_pair(item->name, item)); + return types.insert(std::make_pair(item->name, item)).second; } void ExtensionManager::BeginUnregister(Module* module, std::vector<reference<ExtensionItem> >& list) |