Results 1 to 6 of 6

Thread: Freeing DTM's. I thought I did it right , I guess not

  1. #1
    Join Date
    Mar 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Freeing DTM's. I thought I did it right , I guess not

    Code:
    procedure ScriptTerminate;
    var
      i: integer;
    begin
      for i := 1 to 9 do
        FreeBitmap(DTM[i]);
      Disguise(' end ');
    end;
    The following DTMs were not freed: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19].

    I thought this was to be how to free them but I'm having problems still, after my first run.
    so assuming I'm not doing right, help would be appreciate.
    Is not there a procedure to free all DTM's instead of specific one?

    Apologize for grammar. Not English first. Thanks very much for help!

    :: Confuses me such more for my friend uses same script and has not issues.
    I'm pretty sure my client is up to day I think, and my other things.
    I can only successfully run once for a while, before problems. Only 4 Successful uses so far, out of many. After first success then no good performance.
    Last edited by tifalynn; 04-11-2013 at 04:33 PM.

  2. #2
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    your calling freeBitmap, which free's bitmaps not DTMs. use freeDTM(dtm[i])

    iirc there is a function in srl5 called "freeDTMs" that accepts a TIntegerArray of dtms.

  3. #3
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    SRL has some DTMs that are loaded when you setup srl, if i recall correctly. I get this some times too.

    Oh. on second look it appears as if you are using freebitmap to free a DTM. Switch that over to FreeDTM(DTM[i]);

    Also you may want to, as the script is starting up use AddOnTerminate('ScriptTerminate'); to automatically run that function when the script terminates, whether normally or unexpectedly.

  4. #4
    Join Date
    Mar 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    ah. that make sense. Though if my script use Bitmap that need to be freed too, would this break it?

    Does my problem correlate with issue? Like I get success a few times. 2, maybe even 3 rarely, loops(?) but then misfunction

    Thanks so far!

  5. #5
    Join Date
    Mar 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    your calling freeBitmap, which free's bitmaps not DTMs. use freeDTM(dtm[i])

    iirc there is a function in srl5 called "freeDTMs" that accepts a TIntegerArray of dtms.
    Not sure how I missed this.
    I think by changing that its functioning now. Lower failure rates!
    ^_^.

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by tifalynn View Post
    ah. that make sense. Though if my script use Bitmap that need to be freed too, would this break it?

    Does my problem correlate with issue? Like I get success a few times. 2, maybe even 3 rarely, loops(?) but then misfunction

    Thanks so far!
    I think you're asking if you'd need to free the bitmaps as well as the DTMs, and the answer to that is yes. By not freeing the DTMs and bitmaps you'll be unnecessarily using memory, slowing your PC down.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •