Ticket #1433: pespacket_fix.patch

File pespacket_fix.patch, 1.2 KB (added by Janne <janne-mythtv@…>, 18 years ago)
  • libs/libmythtv/mpeg/pespacket.cpp

     
    162162static void return_188_block(unsigned char* ptr)
    163163{
    164164    alloc188.erase(ptr);
    165     if (alloc188.size())
    166         free188.push_back(ptr);
     165    free188.push_back(ptr);
    167166    // free the allocator only if more than 1 block was used
    168     else if (mem188.size() > 1)
     167    if (mem188.size() > 1)
    169168    {
    170169        vector<unsigned char*>::iterator it;
    171170        for (it = mem188.begin(); it != mem188.end(); ++it)
     
    203202static void return_4096_block(unsigned char* ptr)
    204203{
    205204    alloc4096.erase(ptr);
    206     if (alloc4096.size())
    207     {
    208         free4096.push_back(ptr);
     205    free4096.push_back(ptr);
    209206
    210207#if 0 // enable this to debug memory leaks
    211208        cerr<<alloc4096.size()<<" 4096 blocks remain"<<endl;
     
    223220            cerr<<endl;
    224221        }
    225222#endif
    226     }
     223
    227224    // free the allocator only if more than 1 block was used
    228     else if (mem4096.size() > 1)
     225    if (mem4096.size() > 1)
    229226    {
    230227        vector<unsigned char*>::iterator it;
    231228        for (it = mem4096.begin(); it != mem4096.end(); ++it)