Sitemap

Amicuk Programming Answers

Memory leak when passing variables to functions in StarOffice Basic

-0001-11-30   Views:0

Advertisement

The following code generates a fast memory leak: Sub Main Dim i&      for i = 1 to 1000000           Model(i)      next i End Sub Sub Model(j&)      j = j End Sub But if you put the contents of Sub Model into Main, or if you make j a public variab

The following code generates a fast memory leak:
Sub Main
Dim i&
     for i = 1 to 1000000
          Model(i)
     next i
End Sub
Sub Model(j&)
     j = j
End Sub
But if you put the contents of Sub Model into Main, or if you make j a public variable and don't pass it explicitly to Model, the memory leak disappears.
Message was edited by:
capnbob

The replay answer
Advertisement
That's a bit different for event handlers like the onRelease
event of buttons.
mybutton.onRelease = myfunction(1); -> the code will
execute right away without waiting for the event to fire
mybutton.onRelease = myfunction(); -> the code will
execute right away without waiting for the event to fire
mybutton.onRelease = myfunction; -> myfunction gets called
after the event onRelease fires.
See attached code.

Go to See the other 4 answers

Memory leak when passing variables to functions in StarOffice Basic

Category:DefaultRelease time:-0001-11-30Views:130

The following code generates a fast memory leak: Sub Main Dim i&      for i = 1 to 1000000           Model(i)      next i End Sub Sub Model(j&)      j = j End Sub But if you put the contents of Sub Model into Main, or if you make j a public variab[More]

Passing variable with function in AS3

Category:DefaultRelease time:-0001-11-30Views:130

This is a function on the first frame of a .fla updated to AS3 from an old AS2 file: function initialize() { MovieClip(root).stage_target_mc.max_messages = 600; When the function is called it should set "max_messages" to 600 in AS3, right? Thank[More]

Memory leak in a function registered using set_restore_function()

Category:DefaultRelease time:-0001-11-30Views:130

I experience a problem with memory leak caused by the following function: void RestorePhonemesSet(PhonemesSetStructType &phonemesSet, const void *src) { char p = (char ) src; memcpy(&phonemesSet.len, p, sizeof (int)); p += sizeof (int); memcpy(&am[More]

Passing variables: Functions

Category:DefaultRelease time:-0001-11-30Views:130

Sorry if this is nooby questions: How can i pass variables between functions in AS. I know how to return a value and you can pass parameters into a function but say I had an outer function (say "a") with a local var (say "vara") with a[More]

Fortran memory leaks

Category:DefaultRelease time:-0001-11-30Views:130

I'm trying to determine whether we have any memory leaks in our Fortran 95 program using check -leaks. We use several allocate and deallocate statements and using the showleaks command in dbx does show a memory leak, but nothing seems to change wheth[More]

What are different ways to pass variables in a c# program?

Category:DefaultRelease time:2015-10-11Views:130

What are different ways to pass variables in a c# program? I was wondering if : var numbers = textBox1.Text.Split(' .Select(int.Parse).ToArray(); var min = numbers.Min(); var max = numbers.Max(); textBox2.Text = string.Format("min: {0} max: {1}"[More]

I am experiencing a memory leak when I write to a file in a loop.

Category:DefaultRelease time:-0001-11-30Views:130

I am conducting a cycling test, each cycle represents about 48k of memory. I collect a selectable number of cycles into a shift register. When the chosen number of cycles is reached, I write the data to text files and then clear out the shift registe[More]

Memory leak with callback function

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I am fairly new to LabWindows and the ninetv library, i have mostly been working with LabVIEW. I am trying to create a basic (no GUI) c++ client that sets up subscriptions to several network variables publishing DAQ data from a PXI. The data for[More]

Memory leak problem while passing Object to stored procedure from C++ code

Category:DefaultRelease time:2015-10-11Views:130

Hi, I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code : 1) created objects in oracle with the help of "create or replace type as objects" 2) generated C+[More]

Memory leak in JCO when calling an ABAP-function that returns larg tables

Category:DefaultRelease time:2015-10-11Views:130

Hello everybody, I think discovered a memory leak in JCO when the calling functionions that have exporting tables with large datasets. For example the ABAP-function RFC_READ_TABLE, which in this example I use to retrieve data from a table called "RSZ[More]

Memory Leak in terminateConnection() function. How to resolve it ???

Category:DefaultRelease time:2015-10-11Views:130

Hi, We are facing a memory leak issue in terminateConnection() function. Here is a sample code regarding that. We have run around 1.5 hours simultaneously and it was consuming around 250MB for this simple program. How could I resolve this problem ? b[More]

Hot
I am trying to install BOEXI R3 on w2k3 64-bit OS in a SQL Server 2005 x64 database, I am currently at the installation step where i Specify an exisiting CMS database. I created a System DSN and tested it, and it was successful. So when I got to the [More]
Do you have a creative recording technique you'd like to share? Did placing that vocal microphone inside an empty plastic bucket give your bass a crazy tone? Did you try plucking your guitar strings with a school eraser to round off those high freque [More]
Hi all, I have a scenario where the user needs a list of materials that is sorted by material text, which is used as a web based sales order creation application. This list can be very long (1000+ lines) and is shown in a Table where one of the colum [More]
When trying to open an html file firefox keeps opening the open file dialog in a new tab. I have run malware byte with no success. The file never opens. Finally refreshed Firefox problem resolved...I am happy to hear that you solved it I will lock th [More]
I'm having difficulty syncing some apps between devices so that data is saved. I recently purchased an iPad mini for my daughter and want her to have some of her existing game apps to play, and then delete from my iPad. Anyone encountered the same, o [More]
Hi, I have around 100 work order numbers, based on which I want to find out the failed Idoc numbers. These work order numbers are part of one of the segment fields in IDocs. I know the message type of the IDocs. I do not want to use transaction WE09 [More]
After Post Installation Activities of BI and Integration with R/3 following SAP Best Practices Configuration Guide  ( http://help.sap.com/bp_bw370/BBLibrary/HTML/B84_EN_DE.htm)  . I am unable to find the Info Objects in RSA1Hello, Have you activated [More]
Three days ago, March 27, evening, Pacific Daylight Time, I tried to download something from iTunes from my Mac.  I had always used my iPad before.  It downloaded it, then when I went to play it, it said the Mac was not authorized and window came up [More]
I'm noticing that since I upgraded to iTunes 6.04, I'm getting lots and lots of hiccups or blips in music. This phenomenon occurs whether I'm streaming music from a radio connection, playing back MP3 of AIF from a CD, or listening to the same cuts on [More]
When importing files LR wil ask if I want to organize photos by date. I'd like to be able to automatically create folders based on total size of files in the folder. The size could be specified at the import time. When the total size reaches the max [More]