*/}}
YimingWu пре 1 недеља
родитељ
комит
ab108c1bde
3 измењених фајлова са 10 додато и 5 уклоњено
  1. 5 0
      la_util.c
  2. 4 4
      resources/la_nodes_basic.c
  3. 1 1
      resources/la_templates.c

+ 5 - 0
la_util.c

@@ -1414,6 +1414,11 @@ void memDestroyPool(laMemoryPool *mph){
 // Leave memory in an temporary place and if when push difference these are still not acquired, free them.
 void memLeave(void *Data){
     laListHandle* l=hsh65536DoHashLongPtr(MAIN.DBInstMemLeft,Data); lstAppendPointer(l,Data);
+    int level; void* head = memGetHead(Data, &level);
+    laMemoryPoolPart *mp;
+    if(level==2) { mp = ((laMemNodeHyper*)head)->InPool; laDataBlockNoLongerExists(Data,&((laMemNodeHyper*)head)->Users);
+        laListHandle* l=hsh65536DoHashNUID(&MAIN.DBInst2,((laMemNodeHyper*)head)->NUID.String); lstRemoveItem(l,head);}
+    if(level==1) { mp = ((laMemNode*)head)->InPool; laDataBlockNoLongerExists(Data,&((laMemNode*)head)->Users); }
 }
 void memTake(void *Data){
     laListHandle* l=hsh65536DoHashLongPtr(MAIN.DBInstMemLeft,Data); lstRemovePointer(l,Data);

+ 4 - 4
resources/la_nodes_basic.c

@@ -1019,7 +1019,7 @@ int OPINV_AddNodesRack(laOperator* a, laEvent *e){
 laBaseNode* la_CreateNode(laNodeRack* ir, laBaseNodeType* NodeType){
     laBaseNode* bn=memAcquire(NodeType->NodeSize);
     bn->Type=NodeType; NodeType->Init(bn, 0); bn->InitDone=1; lstAppendItem(&ir->Nodes, bn); bn->InRack=ir;
-    laNotifyInstanceUsers(ir); laRecordInstanceDifferences(ir,"la_node_rack"); laPushDifferences("Add Node", 0);
+    laNotifyInstanceUsers(ir); laRecordInstanceDifferences(ir->ParentPage,"la_rack_page"); laPushDifferences("Add Node", 0);
     return bn;
 }
 
@@ -1086,12 +1086,12 @@ int OPINV_MoveNodeToRack(laOperator* a, laEvent *e){
 }
 int OPINV_DeleteNode(laOperator* a, laEvent *e){
     laBaseNode* n=a->This?a->This->EndInstance:0; if(!n||!n->InRack) return LA_CANCELED;
-    laBaseNodeType* bnt=0; laNodeRack* target;
+    laBaseNodeType* bnt=0; laNodeRack* target; printf("\n\n");
     laNodeRack* parent=n->InRack;
 
     lstRemoveItem(&n->InRack->Nodes, n); n->Type->Destroy(n); memLeave(n);
     laGraphRequestRebuild();
-    laNotifyInstanceUsers(parent); laRecordInstanceDifferences(parent,"la_node_rack"); laPushDifferences("Delete Node", 0);
+    laNotifyInstanceUsers(parent); laRecordInstanceDifferences(parent->ParentPage,"la_rack_page"); laPushDifferences("Delete Node", 0);
 
     return LA_FINISHED;
 }
@@ -1577,7 +1577,7 @@ int laRunPage(laRackPage* rp, uint64_t mask){
 
 laNodeOutSocket* laCreateOutSocket(void* NodeParentOptional, char* label, int DataType){
     laNodeOutSocket* os=memAcquire(sizeof(laNodeOutSocket));
-    strSafeSet(&os->Label, label); os->DataType = DataType; os->Parent=NodeParentOptional;
+    strSafeSet(&os->Label, label); os->DataType = DataType; memAssignRef(os,&os->Parent,NodeParentOptional);
     return os;
 }
 laNodeInSocket* laCreateInSocket(char* label, int DataType){

+ 1 - 1
resources/la_templates.c

@@ -1343,7 +1343,7 @@ void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laCol
     if(nc->Ui){ nc->Ui(uil,This,Extra,0,context); return; }
     char buf[512]={0};
     for(laListItemPointer* lip=nc->NodeTypes.pFirst;lip;lip=lip->pNext){
-        laBaseNodeType* nt=lip->p; logPrintNew("%d",nt);
+        laBaseNodeType* nt=lip->p;
         sprintf(buf,"feedback=%s;text=%s;icon=%lc;",nt->TypeName?nt->TypeName:" ",nt->Name?nt->Name:" ",nt->Icon?nt->Icon:L' ');
         laShowItemFull(uil,c,0,"LA_confirm",0,buf,0,0);
     }