Cardinal/src/override/diffs/context.cpp.diff
falkTX 3ede7c2b05
regen Rack patch diffs
Signed-off-by: falkTX <falktx@falktx.com>
2023-08-28 09:56:27 +02:00

68 lines
1.9 KiB
Diff

--- ../Rack/src/context.cpp 2023-05-20 17:03:33.006081772 +0200
+++ context.cpp 2023-05-20 18:08:56.497736615 +0200
@@ -1,14 +1,44 @@
+/*
+ * DISTRHO Cardinal Plugin
+ * Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of
+ * the License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * For a full copy of the GNU General Public License see the LICENSE file.
+ */
+
+/**
+ * This file is an edited version of VCVRack's context.cpp
+ * Copyright (C) 2016-2023 VCV.
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of
+ * the License, or (at your option) any later version.
+ */
+
#include <context.hpp>
#include <window/Window.hpp>
#include <patch.hpp>
#include <engine/Engine.hpp>
#include <app/Scene.hpp>
#include <history.hpp>
-#include <midiloopback.hpp>
+#ifdef NDEBUG
+# undef DEBUG
+#endif
-namespace rack {
+#include "DistrhoUtils.hpp"
+namespace rack {
Context::~Context() {
// Deleting NULL is safe in C++.
@@ -38,17 +68,13 @@
INFO("Deleting engine");
delete engine;
engine = NULL;
-
- INFO("Deleting MIDI loopback");
- delete midiLoopbackContext;
- midiLoopbackContext = NULL;
}
static thread_local Context* threadContext = NULL;
Context* contextGet() {
- assert(threadContext);
+ DISTRHO_SAFE_ASSERT(threadContext != nullptr);
return threadContext;
}