Fix potential crash at exit/close.
[ardour.git] / libs / backends / jack / jack_connection.cc
index f9824143cebfa14a18b0db434a6d2f43a7800984..2747832ec004911d4e3aecf107cf533c3f2a84d7 100644 (file)
@@ -56,8 +56,10 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
        : _jack (0)
        , _client_name (arg1)
        , session_uuid (arg2)
+       , _probed_buffer_size (0)
+       , _probed_sample_rate (0)
 {
-       /* See if the server is already up 
+       /* See if the server is already up
         */
 
         EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
@@ -77,6 +79,8 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
        jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
 
        if (status == 0) {
+               _probed_buffer_size = jack_get_buffer_size(c);
+               _probed_sample_rate = jack_get_sample_rate(c);
                jack_client_close (c);
                _in_control = false;
        } else {
@@ -141,7 +145,7 @@ JackConnection::close ()
 {
        GET_PRIVATE_JACK_POINTER_RET (_jack, -1);
 
-       if (_priv_jack) {       
+       if (_priv_jack) {
                int ret = jack_client_close (_priv_jack);
                _jack = 0;