Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Use jack_free to free memory allocated by Jack (fix MSVC crashes) #154

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/qjackctlJackConnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ int qjackctlJackClientList::updateClientPorts (void)
pPort->markClientPort(1);
}
}
::free(ppszClientPorts);
jack_free(ppszClientPorts);
}

iDirtyCount += cleanClientPorts(0);
Expand Down Expand Up @@ -605,7 +605,7 @@ void qjackctlJackConnect::updateConnections (void)
pIPort->addConnect(pOPort);
}
}
::free(ppszClientPorts);
jack_free(ppszClientPorts);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/qjackctlJackGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,11 @@ void qjackctlJackGraph::updateItems (void)
}
}
}
::free(client_ports2);
jack_free(client_ports2);
}
}

::free(client_ports1);
jack_free(client_ports1);

// 3. Clean-up all un-marked items...
//
Expand Down
26 changes: 13 additions & 13 deletions src/qjackctlPatchbayRack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ void qjackctlPatchbayRack::connectJackSocketPorts (
else if (pOutputSocket->isExclusive())
disconnectJackPorts(pszOutputPort, ppszInputPorts[i]);
}
::free(ppszInputPorts);
jack_free(ppszInputPorts);
}

// Check for outputs from input, if the input socket is on exclusive mode...
Expand All @@ -780,7 +780,7 @@ void qjackctlPatchbayRack::connectJackSocketPorts (
else
disconnectJackPorts(ppszOutputPorts[i], pszInputPort);
}
::free(ppszOutputPorts);
jack_free(ppszOutputPorts);
}
}

Expand Down Expand Up @@ -887,14 +887,14 @@ void qjackctlPatchbayRack::connectJackScan ( jack_client_t *pJackClient )

// Free client-ports caches...
if (m_ppszOAudioPorts)
::free(m_ppszOAudioPorts);
jack_free(m_ppszOAudioPorts);
if (m_ppszIAudioPorts)
::free(m_ppszIAudioPorts);
jack_free(m_ppszIAudioPorts);
#ifdef CONFIG_JACK_MIDI
if (m_ppszOMidiPorts)
::free(m_ppszOMidiPorts);
jack_free(m_ppszOMidiPorts);
if (m_ppszIMidiPorts)
::free(m_ppszIMidiPorts);
jack_free(m_ppszIMidiPorts);
#endif
// Reset cached pointers.
m_ppszOAudioPorts = nullptr;
Expand Down Expand Up @@ -934,8 +934,8 @@ void qjackctlPatchbayRack::connectJackForwardPorts (
}
// Free provided arrays...
if (ppszPorts)
::free(ppszPorts);
::free(ppszOutputPorts);
jack_free(ppszPorts);
jack_free(ppszOutputPorts);
}
}

Expand Down Expand Up @@ -1501,7 +1501,7 @@ void qjackctlPatchbayRack::connectJackSnapshotEx ( int iSocketType )
qjackctlPatchbaySnapshot::add_socket(
isocketlist(), sIClient, sIPort, iSocketType);
}
::free(ppszInputPorts);
jack_free(ppszInputPorts);
}

const char **ppszOutputPorts = jack_get_ports(m_pJackClient,
Expand Down Expand Up @@ -1530,9 +1530,9 @@ void qjackctlPatchbayRack::connectJackSnapshotEx ( int iSocketType )
const QString& sIPort = sInputPort.section(':', 1);
snapshot.append(sOClient, sOPort, sIClient, sIPort);
}
::free(ppszInputPorts);
jack_free(ppszInputPorts);
}
::free(ppszOutputPorts);
jack_free(ppszOutputPorts);

snapshot.commit(this, iSocketType);
}
Expand Down Expand Up @@ -1643,9 +1643,9 @@ void qjackctlPatchbayRack::disconnectAllJackPortsEx ( int iSocketType )
const char *pszInputPort = ppszInputPorts[j];
jack_disconnect(m_pJackClient, pszOutputPort, pszInputPort);
}
::free(ppszInputPorts);
jack_free(ppszInputPorts);
}
::free(ppszOutputPorts);
jack_free(ppszOutputPorts);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/qjackctlSocketForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void qjackctlSocketForm::updateJackClients ( int iSocketType )
}
iClientPort++;
}
::free(ppszClientPorts);
jack_free(ppszClientPorts);
}
}

Expand Down Expand Up @@ -831,7 +831,7 @@ void qjackctlSocketForm::updateJackPlugs ( int iSocketType )
}
++iClientPort;
}
::free(ppszClientPorts);
jack_free(ppszClientPorts);
}
}

Expand Down