IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18701


Ignore:
Timestamp:
Jul 23, 2008, 5:42:38 PM (18 years ago)
Author:
Paul Price
Message:

Attempts to fix case where there's a single skycell in the tree: then
the child->data is NULL. Not sure I'm returning the right value from
findReadyNodes().
Fixing memory problem caused by freeing hash before done with the contents.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/magictool.c

    r18698 r18701  
    699699    }
    700700
     701    if (!node->data) {
     702        // It's a leaf node, not done
     703        return false;
     704    }
     705
    701706    if (psMetadataLookupBool(NULL, node->data, "done")) {
    702707        // It's already done
     
    712717        while ((child = psListGetAndIncrement(iter))) {
    713718            psMetadata *data = child->data;
     719            if (!data) {
     720                // Child is a leaf node, not done
     721                psFree(iter);
     722                psFree(work);
     723                return false;
     724            }
    714725
    715726            bool status = false;
     
    853864
    854865    // find the root of the tree
    855     pxNode *root = psHashLookup(forest, "root");
     866    pxNode *root = psMemIncrRefCounter(psHashLookup(forest, "root"));
    856867    psFree(forest);
    857     // pxTreePrint(stdout, root);
     868    //    pxTreePrint(stdout, root);
    858869
    859870    // crawl through the tree and looking for nodes with children that are all
Note: See TracChangeset for help on using the changeset viewer.