You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6KB

  1. --- ../Rack/src/context.cpp 2022-01-15 11:59:46.188414546 +0000
  2. +++ context.cpp 2022-01-24 00:11:36.628498885 +0000
  3. @@ -1,3 +1,30 @@
  4. +/*
  5. + * DISTRHO Cardinal Plugin
  6. + * Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
  7. + *
  8. + * This program is free software; you can redistribute it and/or
  9. + * modify it under the terms of the GNU General Public License as
  10. + * published by the Free Software Foundation; either version 3 of
  11. + * the License, or any later version.
  12. + *
  13. + * This program is distributed in the hope that it will be useful,
  14. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. + * GNU General Public License for more details.
  17. + *
  18. + * For a full copy of the GNU General Public License see the LICENSE file.
  19. + */
  20. +
  21. +/**
  22. + * This file is an edited version of VCVRack's context.cpp
  23. + * Copyright (C) 2016-2021 VCV.
  24. + *
  25. + * This program is free software: you can redistribute it and/or
  26. + * modify it under the terms of the GNU General Public License as
  27. + * published by the Free Software Foundation; either version 3 of
  28. + * the License, or (at your option) any later version.
  29. + */
  30. +
  31. #include <context.hpp>
  32. #include <window/Window.hpp>
  33. #include <patch.hpp>
  34. @@ -6,9 +33,13 @@
  35. #include <history.hpp>
  36. #include <settings.hpp>
  37. +#ifdef NDEBUG
  38. +# undef DEBUG
  39. +#endif
  40. -namespace rack {
  41. +#include "DistrhoUtils.hpp"
  42. +namespace rack {
  43. Context::~Context() {
  44. // Deleting NULL is safe in C++.
  45. @@ -44,7 +75,7 @@
  46. static thread_local Context* threadContext = NULL;
  47. Context* contextGet() {
  48. - assert(threadContext);
  49. + DISTRHO_SAFE_ASSERT(threadContext != nullptr);
  50. return threadContext;
  51. }