Skip to content

Commit

Permalink
fix: Delete HybridObject copy & move ctors (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy authored Dec 6, 2024
1 parent 4956fed commit 5147fc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

namespace margelo::nitro {

JNitroModules::JNitroModules() = default;

jni::local_ref<JNitroModules::jhybriddata> JNitroModules::initHybrid(jni::alias_ref<JNitroModules::jhybridobject>) {
return makeCxxInstance();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class JNitroModules final : public jni::HybridClass<JNitroModules> {
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/NitroModules;";

private:
explicit JNitroModules();
explicit JNitroModules() = default;

private:
// JNI Methods
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-nitro-modules/cpp/core/HybridObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class HybridObject : public virtual jsi::NativeState, public HybridObjectPrototy
/**
* HybridObjects cannot be copied.
*/
HybridObject(const HybridObject& copy) = default;
HybridObject(const HybridObject& copy) = delete;
/**
* HybridObjects cannot be moved.
*/
HybridObject(HybridObject&& move) = default;
HybridObject(HybridObject&& move) = delete;
/**
* HybridObjects cannot be default-constructed!
*/
Expand Down

0 comments on commit 5147fc7

Please sign in to comment.