Ticket #5574: mythphone-delete-array.patch

File mythphone-delete-array.patch, 3.8 KB (added by Erik Hovland <erik@…>, 17 years ago)

Adds [] to delete where necessary

  • mythplugins/mythphone/mythphone/sipfsm.cpp

    Fixes instances where an array should have been deleted but wasn't.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythplugins/mythphone/mythphone/sipfsm.cpp  |    4 ++--
     mythplugins/mythphone/mythphone/tone.cpp    |    2 +-
     mythplugins/mythphone/mythphone/vxml.cpp    |    6 +++---
     mythplugins/mythphone/mythphone/wavfile.cpp |    2 +-
     mythplugins/mythphone/mythphone/webcam.cpp  |    2 +-
     5 files changed, 8 insertions(+), 8 deletions(-)
    
    diff --git a/mythplugins/mythphone/mythphone/sipfsm.cpp b/mythplugins/mythphone/mythphone/sipfsm.cpp
    index 2efbef8..6ea457a 100644
    a b QString SipFsm::DetermineNatAddress()  
    824824
    825825                        if (resp.contains("200 OK") && !resp.contains("</body"))
    826826                        {
    827                             delete httpResponse;
     827                            delete [] httpResponse;
    828828                            continue;
    829829                        }
    830830                        QString temp1 = resp.section("<body>", 1, 1);
    QString SipFsm::DetermineNatAddress()  
    839839                        VERBOSE(VB_IMPORTANT,
    840840                                "SIP: Got invalid HTML response "
    841841                                "whilst detecting your NAT settings");
    842                         delete httpResponse;
     842                        delete [] httpResponse;
    843843                        break;
    844844                    }
    845845                }
  • mythplugins/mythphone/mythphone/tone.cpp

    diff --git a/mythplugins/mythphone/mythphone/tone.cpp b/mythplugins/mythphone/mythphone/tone.cpp
    index 8cb8c0a..c01d87f 100644
    a b Tone::~Tone()  
    182182    Stop();
    183183
    184184    if (toneBuffer)
    185         delete toneBuffer;
     185        delete [] toneBuffer;
    186186    toneBuffer = 0;
    187187}
    188188
  • mythplugins/mythphone/mythphone/vxml.cpp

    diff --git a/mythplugins/mythphone/mythphone/vxml.cpp b/mythplugins/mythphone/mythphone/vxml.cpp
    index 80bc8c3..549a1c5 100644
    a b bool vxmlParser::loadVxmlPage(QString strUrl, QString Method, QString Namelist,  
    327327                    QString firstLine = resp.section('\n', 0);
    328328                    if ((firstLine.contains("200 OK")) && !resp.contains("</vxml>"))
    329329                    {
    330                         delete httpResponse;
     330                        delete [] httpResponse;
    331331                        continue;
    332332                    }
    333333
    bool vxmlParser::loadVxmlPage(QString strUrl, QString Method, QString Namelist,  
    335335                    script.setContent(Content);
    336336                    //cout << "Got VXML content\n" << Content << endl;
    337337                }
    338                 delete httpResponse;
     338                delete [] httpResponse;
    339339                break;
    340340            }
    341341        }
    void vxmlParser::PlayBeep(int freqHz, int volume, int ms)  
    845845
    846846    Rtp->Transmit(beepBuffer, Samples);
    847847    waitUntilFinished(false);
    848     delete beepBuffer;
     848    delete [] beepBuffer;
    849849}
    850850
    851851
  • mythplugins/mythphone/mythphone/wavfile.cpp

    diff --git a/mythplugins/mythphone/mythphone/wavfile.cpp b/mythplugins/mythphone/mythphone/wavfile.cpp
    index 06cf45a..aefbece 100644
    a b wavfile::wavfile()  
    2828wavfile::~wavfile()
    2929{
    3030    if (loaded && audio)
    31         delete audio;
     31        delete [] audio;
    3232}
    3333
    3434bool wavfile::load(const char *Filename)
  • mythplugins/mythphone/mythphone/webcam.cpp

    diff --git a/mythplugins/mythphone/mythphone/webcam.cpp b/mythplugins/mythphone/mythphone/webcam.cpp
    index 7a94474..9e345fb 100644
    a b void Webcam::camClose()  
    219219#endif
    220220
    221221    if (picbuff1)
    222         delete picbuff1;
     222        delete [] picbuff1;
    223223
    224224    picbuff1 = 0;
    225225}