Skip to content

Commit 1c16f1c

Browse files
committed
Do not register existing extensions
1 parent 4eb7b78 commit 1c16f1c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/scratchconfiguration_p.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
#include <scratchcpp/iextension.h>
4+
#include <algorithm>
45

56
#include "scratchconfiguration_p.h"
67

78
using namespace libscratchcpp;
89

910
void ScratchConfigurationPrivate::registerExtension(std::shared_ptr<IExtension> extension)
1011
{
12+
if (std::find(extensions.begin(), extensions.end(), extension) != extensions.cend())
13+
return;
14+
1115
extensions.push_back(extension);
1216
}
1317

0 commit comments

Comments
 (0)