Fixed a segfault in the buffer on track deletion, added a WARN-level message when/if something similar occurs.
This commit is contained in:
parent
4c1760f5f7
commit
aa2dd8491c
2 changed files with 15 additions and 8 deletions
|
@ -1116,6 +1116,9 @@ namespace IPC {
|
||||||
|
|
||||||
userConnection::userConnection(char * _data) {
|
userConnection::userConnection(char * _data) {
|
||||||
data = _data;
|
data = _data;
|
||||||
|
if (!data){
|
||||||
|
WARN_MSG("userConnection created with null pointer!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long userConnection::getTrackId(size_t offset) const {
|
unsigned long userConnection::getTrackId(size_t offset) const {
|
||||||
|
|
|
@ -514,14 +514,18 @@ namespace Mist {
|
||||||
nProxy.curPage.erase(tid);
|
nProxy.curPage.erase(tid);
|
||||||
bufferLocations[tid].erase(bufferLocations[tid].begin());
|
bufferLocations[tid].erase(bufferLocations[tid].begin());
|
||||||
}
|
}
|
||||||
if (pushLocation.count(it->first)){
|
if (pushLocation.count(it->first)) {
|
||||||
//Reset the userpage, to allow repushing from TS
|
// \todo Debugger says this is null sometimes. It shouldn't be. Figure out why!
|
||||||
IPC::userConnection userConn(pushLocation[it->first]);
|
// For now, this if will prevent crashes in these cases.
|
||||||
for (int i = 0; i < SIMUL_TRACKS; i++){
|
if (pushLocation[it->first]){
|
||||||
if (userConn.getTrackId(i) == it->first) {
|
//Reset the userpage, to allow repushing from TS
|
||||||
userConn.setTrackId(i, 0);
|
IPC::userConnection userConn(pushLocation[it->first]);
|
||||||
userConn.setKeynum(i, 0);
|
for (int i = 0; i < SIMUL_TRACKS; i++) {
|
||||||
break;
|
if (userConn.getTrackId(i) == it->first) {
|
||||||
|
userConn.setTrackId(i, 0);
|
||||||
|
userConn.setKeynum(i, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pushLocation.erase(it->first);
|
pushLocation.erase(it->first);
|
||||||
|
|
Loading…
Add table
Reference in a new issue