Browse Source

Misc

tags/1.9.4
falkTX 10 years ago
parent
commit
e3ded0a744
3 changed files with 25 additions and 19 deletions
  1. +19
    -15
      source/backend/engine/CarlaEngineOsc.cpp
  2. +1
    -3
      source/backend/engine/CarlaEngineThread.cpp
  3. +5
    -1
      source/includes/CarlaDefines.h

+ 19
- 15
source/backend/engine/CarlaEngineOsc.cpp View File

@@ -116,9 +116,7 @@ void CarlaEngineOsc::idle() const noexcept
if (lo_server_recv_noblock(fServerTCP, 0) == 0)
break;
}
catch(...) {
break;
}
CARLA_SAFE_EXCEPTION_BREAK("OSC idle TCP")
}
}

@@ -130,9 +128,7 @@ void CarlaEngineOsc::idle() const noexcept
if (lo_server_recv_noblock(fServerUDP, 0) == 0)
break;
}
catch(...) {
break;
}
CARLA_SAFE_EXCEPTION_BREAK("OSC idle UDP")
}
}
}
@@ -152,10 +148,14 @@ void CarlaEngineOsc::close() noexcept
{
try {
lo_server_del_method(fServerTCP, nullptr, nullptr);
} catch(...) {}
}
CARLA_SAFE_EXCEPTION("lo_server_del_method TCP")

try {
lo_server_free(fServerTCP);
} catch(...) {}
}
CARLA_SAFE_EXCEPTION("lo_server_free TCP")

fServerTCP = nullptr;
}

@@ -163,10 +163,14 @@ void CarlaEngineOsc::close() noexcept
{
try {
lo_server_del_method(fServerUDP, nullptr, nullptr);
} catch(...) {}
}
CARLA_SAFE_EXCEPTION("lo_server_del_method UDP")

try {
lo_server_free(fServerUDP);
} catch(...) {}
}
CARLA_SAFE_EXCEPTION("lo_server_free UDP")

fServerUDP = nullptr;
}

@@ -180,7 +184,7 @@ void CarlaEngineOsc::close() noexcept

// -----------------------------------------------------------------------

static bool isDigit(const char c)
static bool isDigit(const char c) noexcept
{
return (c >= '0' && c <= '9');
}
@@ -210,7 +214,7 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons
// Initial path check
if (std::strcmp(path, "/register") == 0)
{
const lo_address source = lo_message_get_source(msg);
const lo_address source(lo_message_get_source(msg));
return handleMsgRegister(isTCP, argc, argv, types, source);
}
if (std::strcmp(path, "/unregister") == 0)
@@ -286,9 +290,9 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons
}

// Get method from path, "/Carla/i/method" -> "method"
char method[32];
carla_zeroChar(method, 32);
std::strncpy(method, path + (nameSize + offset), 31);
char method[32+1];
method[32] = '\0';
std::strncpy(method, path + (nameSize + offset), 32);

if (method[0] == '\0')
{


+ 1
- 3
source/backend/engine/CarlaEngineThread.cpp View File

@@ -75,9 +75,7 @@ void CarlaEngineThread::run() noexcept
try {
plugin->postRtEventsRun();
}
catch (...) {
carla_stderr2("Caught exception during postRtEventsRun()");
}
CARLA_SAFE_EXCEPTION("postRtEventsRun()")
}

if (hasUi || oscRegisted)


+ 5
- 1
source/includes/CarlaDefines.h View File

@@ -148,7 +148,11 @@
#define CARLA_SAFE_ASSERT_RETURN(cond, ret) if (cond) pass(); else { carla_safe_assert(#cond, __FILE__, __LINE__); return ret; }

/* Define CARLA_SAFE_EXCEPTION */
#define CARLA_SAFE_EXCEPTION(msg, aftercode) catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); aftercode }
#define CARLA_SAFE_EXCEPTION(msg) catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); }

#define CARLA_SAFE_EXCEPTION_BREAK(msg) catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); break; }
#define CARLA_SAFE_EXCEPTION_CONTINUE(msg) catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); continue; }
#define CARLA_SAFE_EXCEPTION_RETURN(msg, ret) catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); return ret; }

/* Define CARLA_DECLARE_NON_COPY_CLASS */
#ifdef CARLA_PROPER_CPP11_SUPPORT


Loading…
Cancel
Save