zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
116 stars 24 forks source link

PasteCommand memory-leak, no error handling #66

Closed m-7761 closed 5 years ago

m-7761 commented 5 years ago

pastecmd.cc

The following code reproduces the viewwin.cc merge error code. The new Model is not deleted.

    if(auto err=FilterManager::getInstance()->readFile(m,clipfile.c_str()))
    {
        if(Model::operationFailed(err))
        msg_error("%s:\n%s",clipfile.c_str(),modelErrStr(err,merge));
    }
m-7761 commented 5 years ago

Unrelated, the SnapCommand is duplicating lists passed to subroutines (if the compiler doesn't save the programmer from themselves.)

The FaceOutCommand has an understatement:

// TODO this is slow, see if we can speed it up

I've made a note to look at it, but at a glance it looks the programmer was just too lazy to refactor it correctly, in favor of brute-forcing their CPU.

zturtleman commented 5 years ago

Thanks, fixed paste memleak/error handling and SnapCommand passing lists in https://github.com/zturtleman/mm3d/compare/5f39e70553b7f11a606308cfec274fdc45994174...ae97979a6b0e396c801292339000abc9314e7f49.