Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 9 of 9 FirstFirst ... 7 8 9
Results 121 to 123 of 123
  1. #121
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Quote Originally Posted by kjh View Post
    Hi AMSWaves
    By accident i discovered that it is possible to use the memory plugin in an easy way.
    Sample code:

    Memory.TblTest={"Bananas","Apples"}
    Dialog.Message(type(Memory.TblTest),Table.Concat(M emory.TblTest, ";", 1, TABLE_ALL))
    -- returns a normal concated string "Bananas;Apples"

    Memory.TblTest=nil
    Dialog.Message("",type(Memory.TblTest))
    -- returns "nil"

    I find this way to use the Memory plugin very useful (and easy), but before I go on with testing the question is:
    is the allocated memory actually freed by setting the used variabel to 'nil'.?

    I hope you will find the time for an answer, thanks in advance.
    You can do that with anything..

    Code:
    Application.ExampleTable = {"stuff", "more stuff", "even more stuff"};
    Dialog.Message("Example", "Entries in table: "..#Application.ExampleTable);
    
    Application.ExampleTable = nil;
    collectgarbage(); -- forcefully invoke garbage collection to free memory.
    Dialog.Message("Example", "Type: "..type(Application.ExampleTable));

  2. #122
    Join Date
    Aug 2007
    Location
    Denmark
    Posts
    21
    Thank you.

  3. #123
    Join Date
    May 2006
    Posts
    5,380
    is the allocated memory actually freed by setting the used variabel to 'nil'.?
    NO, the memory address will no longer be available to the application but it will still exists in the systems memory (this is called a *Memory Leak*)

    you need to free the allocated memory buffer before setting the variable to nil to avoid leaks

    EDIT:

    huh?, in your code, you are not allocating memory, you are simply using a lua table ??
    Last edited by RizlaUK; 09-03-2010 at 07:46 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  4. #124
    Join Date
    Aug 2007
    Location
    Denmark
    Posts
    21
    I am just declaring a lua-table, e.g. Memory.MyTable={} or a Memory.StringVar="Something" and it works.
    Maybe the plugin itself has a lua-table structure whitch handles the different functions, and makes this possible?

    But the question is still if there will be a memory leak, if not its an easy way to handle variabels for use in dialogex and so on

    Thanks for your reply.

  5. #125
    Join Date
    Jul 2010
    Posts
    10
    I've looked through these threads on the AutoIt plug, but seem to be the only one having this issue.

    When i run AutoIt_Example.am7 and compile it, i get On Preload, Line 40:attempt to call field 'OpenLibrary' (a nil value)

    I haven't changed the default layout of the accompaning files, anybody have an idea? (i'm running AMS7.5, Windows 7 Ult x64)

+ Reply to Thread
Page 9 of 9 FirstFirst ... 7 8 9

Tags for this Thread

Posting Permissions

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