Changeset 4880 for nanovis/trunk


Ignore:
Timestamp:
Dec 19, 2014 3:43:54 PM (9 years ago)
Author:
ldelgass
Message:

Fix leak in sendDataToClient method (when USE_THREADS is enabled)

Location:
nanovis/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nanovis/trunk/Command.cpp

    r4823 r4880  
    13631363
    13641364        char info[1024];
    1365         int cmdLength = 
     1365        int cmdLength =
    13661366            sprintf(info, "nv>data tag %s min %g max %g vmin %g vmax %g\n", tag,
    13671367                    volume->wAxis.min(), volume->wAxis.max(),
     
    23452345nv::initTcl(Tcl_Interp *interp, ClientData clientData)
    23462346{
    2347     /*
    2348      * Ideally the connection is authenticated by nanoscale.  I still like the
    2349      * idea of creating a non-safe master interpreter with a safe slave
    2350      * interpreter.  Alias all the nanovis commands in the slave. That way we
    2351      * can still run Tcl code within nanovis.  The eventual goal is to create
    2352      * a test harness through the interpreter for nanovis.
    2353      */
    2354 
    23552347    Tcl_MakeSafe(interp);
    23562348
  • nanovis/trunk/FlowCmd.cpp

    r4353 r4880  
    11391139#endif
    11401140    TRACE("Enter: %s", cmd);
    1141     FILE *f;
    1142     f = popen(cmd, "r");
     1141    FILE *f = popen(cmd, "r");
    11431142    if (f == NULL) {
    11441143        Tcl_AppendResult(interp, "can't run ffmpeg: ",
     
    11491148    size_t total = 0;
    11501149    for (;;) {
    1151         ssize_t numRead;
    11521150        char buffer[BUFSIZ];
    11531151       
    1154         numRead = fread(buffer, sizeof(char), BUFSIZ, f);
     1152        ssize_t numRead = fread(buffer, sizeof(char), BUFSIZ, f);
    11551153        total += numRead;
    11561154        if (numRead == 0) {             // EOF
     
    11801178    sprintf(cmd,"nv>image -type movie -token \"%s\" -bytes %lu\n",
    11811179            token, total);
    1182     // Memory is freed by this call
     1180    // Memory for data payload is freed by this call
    11831181    nv::sendDataToClient(cmd, data, total);
    11841182    return TCL_OK;
  • nanovis/trunk/nanovisServer.cpp

    r4824 r4880  
    311311    }
    312312    delete [] iov;
     313#endif
    313314    free(data);
    314 #endif
    315315}
    316316
Note: See TracChangeset for help on using the changeset viewer.