Menu

UnBalanced Begin/EndUpdate

Help
Fisad
2018-09-17
2018-09-23
  • Fisad

    Fisad - 2018-09-17

    Hi,

    How can I resolve this error message?, after:

    procedure TGLBaseSceneObject.EndUpdate;
    begin
      if FUpdateCount > 0 then
      begin
        Dec(FUpdateCount);
        if FUpdateCount = 0 then
          NotifyChange(Self);
      end
      else
        Assert(False, glsUnBalancedBeginEndUpdate);
    end;
    

    I have searched for information about this message but there is only indication of the text resource file, where the message is included.

    Any idea,

    Thanks!!

     
  • Jerome.D (BeanzMaster)

    Hi Fisad the problem come from your code in your application. You should free a reference of one of your objets. So it cause AV. Impossible to say anithing more without the piece of your code where exception is raise.

     
  • Fisad

    Fisad - 2018-09-18

    Hi Jerome, I understand that the problem is in my code, what I needed to know about what is based on the error, because this happens only when my drawing has more than 15,000 or 20,000 meshes, which makes it difficult to find the source of the problem.

    An interesting thing is that when I run the program without debugging it from the Delphi IDE, the problem is presented immediately but, if I run the program with active debugging, the execution is extremely slow but the problem disappears, which makes it impossible to detect when the error occurs. I think it may be a problem of refreshment of some objects?

     

    Last edit: Fisad 2018-09-18
  • Fisad

    Fisad - 2018-09-18

    Hi, the problem comes from this function (**):

    function TGLBaseSceneObject.InvAbsoluteMatrixAsAddress: PMatrix;
    begin
      if ocInvAbsoluteMatrix in FChanges then
      begin
        if VectorEquals(Scale.DirectVector, XYZHmgVector) then
        begin
          if not Assigned(FAbsoluteMatrix) then
          begin
            GetMem(FAbsoluteMatrix, SizeOf(TMatrix) * 2);
            FInvAbsoluteMatrix := PMatrix(PtrUInt(FAbsoluteMatrix) +
              SizeOf(TMatrix));
          end;
          RebuildMatrix;
          if Parent <> nil then
            **FInvAbsoluteMatrix^ :=
              MatrixMultiply(Parent.InvAbsoluteMatrixAsAddress^,
              AnglePreservingMatrixInvert(FLocalMatrix^))**
          else
            FInvAbsoluteMatrix^ := AnglePreservingMatrixInvert(FLocalMatrix^);
        end
        else
        begin
          FInvAbsoluteMatrix^ := AbsoluteMatrixAsAddress^;
          InvertMatrix(FInvAbsoluteMatrix^);
        end;
        Exclude(FChanges, ocInvAbsoluteMatrix);
      end;
      Result := FInvAbsoluteMatrix;
    end;
    

    There is no error when I execute the process step by step.

    When finish creating thousands of meshes, the drawing is adjusted to the center and then rotated to a predetermined view, in this process the error is generated only if the code runs without interruptions ??

     

    Last edit: Fisad 2018-09-18
  • Jerome.D (BeanzMaster)

    Hi Fisad Try by surrounding your code with BeginUpdate..EndUpdate in the right place. Perhaps you forgot one "BeginUpdate" chek that in your code.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.