Jump to content
Sign in to follow this  
Tripredacus

Ran into a memory leak?

Recommended Posts

Tripredacus

Greetings,

The program I have written (a GUI) that does many things, but mostly installs software. I recently added the ability to test the sound by adding an input line and a button. You type something there, and click the button and it uses Microsoft's Sound synthesizer to read what you typed. I am using a UDF that was posted on this forum someplaced called _talk. Now the problem encountered by our QC people (those who requested this ability) reported that after 3 uses of this line and button, the program will stop responding. It may also have a delay before it starts to read what is typed, at times perhaps 30 seconds, instead of the instantaneous action it performs the first 3 times. Other times, the program will freeze and loop the sound over and over, until you exit the app using it's icon in the system tray.

So I did a test, and made a version that only contained the 3rd tab of my program, which is the tab where this control is kept. This test program, I called defaulted.exe, did not exhibit this problem. It should be noted that the main program is nearly 400 lines long... So to start this, I will post the UDF and the test program code. This is to determine if there is a problem with the code related to the sound testing.

TO start, the UDF:

Func Talk($s_text, $s_voice = 2, $s_TrayTip = 1)
Local $quite = 0
    Local $o_speech = ObjCreate ("SAPI.SpVoice")
    Select
        Case $s_voice == 0
            Return
        Case $s_voice == 1
             $o_speech.Voice = $o_speech.GetVoices("Name=Gergana", "Language=402").Item(0);BG language
            
             If $s_TrayTip == 1 Then
             TrayTip("???????",$s_text,3,16)
             EndIf
            ;no tray tip             
             
        Case $s_voice == 2
             $o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Sam", "Language=409").Item(0)
            
             If $s_TrayTip == 1 Then
             TrayTip("Portable Zippy",$s_text,3,16)
             EndIf
            ;no tray tip
            
    EndSelect
    $o_speech.Speak ($s_text)
    $o_speech = ""
    Sleep(1000)
EndFunc;==>_TalkOBJoÝ÷ Ù8^iº/z¬mç§rWçhºÚ¶¢iÛ-¢·¹Ç¬7zZ0Ëaz׬µªiÂ%vÆ¥Ø^r^çyÛajÜ(ºWg¢¹zØ^Þ·mi¸§¶¦j)é®+jf®¶­sb6æ6ÇVFRfÇC´wV6öç7FçG2æS2fwC°¢6æ6ÇVFRfÇC´3¢b3#µ&öw&ÒfÆW2b3#´WFôC2b3#´æ6ÇVFRb3#´æ6ÇVFRb3#´4ÄWfVçDÆöræS2fwC°¢6æ6ÇVFRfÇCµõFƲæS2fwC° ¦FÒb33cµ%TâÂb33c¶Âb33c¶ÖVÒÂb33c·ÖVÒÂb33c·&W6öÇWFöâÂb33c¶FWFÂb33c¶7RÂb33c´W@¤vÆö&Âb33c¶WfVçDÆörÂb33c¶WfVçDÆös  ¢b33c¶ÖVÒÒÖVÔvWE7FG2¢b33c·ÖVÒÒ&÷VæBb33c¶ÖVÕ³ÒòCSsbÂ2fײgV÷C²t"gV÷C²¢b33c·&W6öÇWFöâÒFW6·F÷vGFfײgV÷C·gV÷C²fײFW6·F÷Vv@¢b33c¶FWFÒFW6·F÷FWFfײgV÷C²&B6öÆ÷"gV÷C°¢b33c¶7RÒ&Vu&VBgV÷C´´UôÄô4ÅôÔ4äRb3#´$Et$Rb3#´DU45$Dôâb3#µ77FVÒb3#´6VçG&Å&ö6W76÷"gV÷C²ÂgV÷Cµ&ö6W76÷$æÖU7G&ærgV÷C² ¢b33c¶ÖçvæF÷rÒwV7&VFRgV÷Cµ6ögGv&R6WGWgV÷C²ÂcCÂC £²F"26öÇVÖâ¢b33c´Æ&VÅó2ÒwV7G&Ä7&VFTÆ&VÂgV÷C´õ2fW'6öã¢gV÷C²fײõ5fW'6öâÂ#ÂSÂ#Â#¢b33c´Æ&VÅóRÒwV7G&Ä7&VFTÆ&VÂgV÷Cµ6W'f6R6³¢gV÷C²fײõ56W'f6U6²Â#ÂsÂ#Â#¢b33c´Æ&VÅórÒwV7G&Ä7&VFTÆ&VÂgV÷C´6ö×WFW"æÖS¢gV÷C²fײ6ö×WFW$æÖRÂ#ÂÂ#Â#¢b33c´Æ&VÅóÒwV7G&Ä7&VFTÆ&VÂgV÷Cµ67&VVâ&W6öÇWFöã¢gV÷C²fײb33c·&W6öÇWFöâÂ#Â#Â#Â#¢b33c´Æ&VÅó2ÒwV7G&Ä7&VFTÆ&VÂgV÷C´6öÆ÷"FWF¢gV÷C²fײb33c¶FWFÂ#ÂCÂ#Â#¢b33c´Æ&VÅóRÒwV7G&Ä7&VFTÆ&VÂgV÷Cµ66ÂÖVÖ÷'¢gV÷C²fײb33c·ÖVÒÂ#ÂcÂ#Â#¢b33c´Æ&VÅórÒwV7G&Ä7&VFTÆ&VÂgV÷Cµ&ö6W76÷#¢gV÷C²fײb33c¶7RÂ#ÂÂ3Â#£²F"26öÇVÖâ ¢b33cµ5ôÆ&VÂÒuT7G&Ä7&VFTÆ&VÂgV÷C´Æ6Föç2ç7FÆÆVBgV÷C²Ã3#ÃSÃ#Ã#¤bfÆTW7G2gV÷C´3¢b3#µ&öw&ÒfÆW2b3#´7&W$Ææ²b3#µ÷vW$EdBb3#µ÷vW$EdBæWRgV÷C²FVà b33cµ3rÒuT7G&Ä7&VFT'WGFöâgV÷Cµ÷vW$EdBgV÷C²Ã3#ÃsÃ#Ã#¤VÇ6P b33cµ3rÒuT7G&Ä7&VFT'WGFöâgV÷Cµ÷vW$EdBgV÷C²Ã3#ÃsÃ#Ã# uT7G&Å6WE7FFRÓÂb33c´uTôD4$ÄR¤VæD`¤bfÆTW7G2gV÷C¶3¢b3#·&öw&ÒfÆW2b3#¶æW&òb3#¶æW&òrb3#¶æW&ò7F'G6Ö'Bb3#¶æW&÷7F'G6Ö'BæWRgV÷C²FVà b33cµ3ÒuT7G&Ä7&VFT'WGFöâgV÷C´æW&òrgV÷C²Ã3#ÃÃ#Ã#¤VÇ6P b33cµ3ÒuT7G&Ä7&VFT'WGFöâgV÷C´æW&òrgV÷C²Ã3#ÃÃ#Ã# uT7G&Å6WE7FFRÓÂb33c´uTôD4$ÄR¤VæD`£²F"26öÇVÖâ0¢b33cµ3"ÒuT7G&Ä7&VFT'WGFöâgV÷C´F6²ÖævVÖVçBgV÷C²ÃSÃSÃ3Ã#¢b33cµ3ÒuT7G&Ä7&VFT'WGFöâgV÷C´FWf6RÖævW"gV÷C²ÃSÃsÃ3Ã#¢b33cµ32ÒuT7G&Ä7&VFT'WGFöâgV÷C´WfVçBfWvW"gV÷C²ÃSÃÃ3Ã#¢b33cµ3BÒuT7G&Ä7&VFT'WGFöâgV÷C´6ÆV"WfVçG2gV÷C²ÃSÃÃ3Ã#¢b33cµ3"ÒuT7G&Ä7&VFT'WGFöâgV÷C´çFW&æWBWÆ÷&W"gV÷C²ÃSÃ3Ã3Ã#¢b33cµ3RÒuT7G&Ä7&VFT'WGFöâgV÷C´FVÆWFRVçW6VB6öç2gV÷C²ÃSÃSÃ3Ã#¢b33cµ3bÒuT7G&Ä7&VFT'WGFöâgV÷Cµ6B6ævW"gV÷C²ÃSÃsÃ3Ã#¢b33cµ3ÒuT7G&Ä7&VFT'WGFöâgV÷C´6ÆV"&V6VçBFö7VÖVçG2gV÷C²ÃSÃÃ3Ã#¢b33cµ3ÒuT7G&Ä7&VFT'WGFöâgV÷C´FVÆWFR'&÷w6ær7F÷'gV÷C²ÃSÃ#Ã3Ã#¢b33cµ3ÒuT7G&Ä7&VFT'WGFöâgV÷Cµ66æF6²gV÷C²ÃSÃ#3Ã3Ã# ¢b33c´TDóÒuT7G&Ä7&VFTçWBgV÷C²gV÷C²Ã#ÃCcÃCÃ#¢b33c´TDõõ%TâÒuT7G&Ä7&VFT'WGFöâgV÷CµFW7BgV÷C²ÃC#ÃCcÃCÃ# ¢b33cµ5ô6ÆVåWÒuT7G&Ä7&VFT'WGFöâgV÷CµW&f÷&Ò6ÆVçWgV÷C²ÃSÃCCÃ#Ã#¢b33c´UC2ÒuT7G&Ä7&VFT'WGFöâgV÷C´WBgV÷C²ÃSÃCcÃ#Ã#µF26W6W2FRÆ6FöâFòW@ ¤uT6WE7FFR ¥vÆR¢b33c¶ä×6rÒuTvWD×6r¢7vF6b33c¶ä×6p 66Rb33cµ3¶FWFV7G2&BG&fW2æB'Vç266æF6²öâFVÐ b33c´4´DBÒG&fTvWDG&fRgV÷C´dTBgV÷C² bäõBW'&÷"FVà ×6t&÷CbÂgV÷C²gV÷C²ÂgV÷C´f÷VæBgV÷C²fײb33c´4´DE³ÒfײgV÷C²G&fW2gV÷C² f÷"b33c¶ÒFòb33c´4´DE³Ð 'VåvBgV÷C¶3¢b3#·væF÷w2b3#·77FVÓ3"b3#¶6¶G6²æWRgV÷C²fײb33c´4´DE²b33c¶Ò æW@ VæD` ×6t&÷CbÂgV÷Cµ66æF6²gV÷C²ÂgV÷C´F6²6V6²6ö×ÆWFVBöâgV÷C²fײb33c´4´DE³ÒfײgV÷C²G&fW2gV÷C² 66Rb33cµ3"²F6²ÖævVÖVç@ 'Vâ77FVÔF"fײgV÷C²b3#¶ÖÖ2æWRgV÷C²fײ77FVÔF"fײgV÷C²b3#¶F6¶Öv×Bæ×62gV÷C² 66Rb33cµ32²÷VâWfVçBfWvW  'Vâ77FVÔF"fײgV÷C²b3#¶WfVçGgw"æWRgV÷C² 66Rb33cµ3B²6ÆV"77FVÒæBÆ6FöâWfVçBÆöw0 b33c¶WfVçDÆörÒôWfVçDÆöuô÷VâgV÷C²gV÷C²ÂgV÷C´Æ6FöâgV÷C² ôWfVçDÆöuô6ÆV"b33c¶WfVçDÆörÂgV÷C´3¢b3#´WgDÆöræ&²gV÷C² ôWfVçDÆöuô6Æ÷6Rb33c¶WfVçDÆör b33c¶WfVçDÆös"ÒôWfVçDÆöuô÷VâgV÷C²gV÷C²ÂgV÷Cµ77FVÒgV÷C² ôWfVçDÆöuô6ÆV"b33c¶WfVçDÆös"ÂgV÷C´3¢b3#´WgE74Æös"æ&²gV÷C² ôWfVçDÆöuô6Æ÷6Rb33c¶WfVçDÆös" ×6t&÷CbÂgV÷C¶WfVçGgw"gV÷C²ÂgV÷C´WfVçBÆöw26ÆV&VBgV÷C² 66Rb33cµ3R²FVÆWFW2VçW6VB6öç0 fÆTFVÆWFRgV÷C¶3¢b3#¶Fö7VÖVçG2æB6WGFæw2b3#¶ÆÂW6W'2b3#¶FW6·F÷b3#´Ö7&÷6ögBÖ÷W6RæÆæ²gV÷C² fÆTFVÆWFRgV÷C¶3¢b3#¶Fö7VÖVçG2æB6WGFæw2b3#¶ÆÂW6W'2b3#¶FW6·F÷b3#´æW&òöæÆæRWw&FRæÆæ²gV÷C² &VtFVÆWFRgV÷C´´Uô5U%$TåEõU4U"b3#µ6ögGv&Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#´WÆ÷&W"b3#´ÖVçT÷&FW"b3#µ7F'BÖVçRgV÷C² &VtFVÆWFRgV÷C´´Uô5U%$TåEõU4U"b3#µ6ögGv&Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#´WÆ÷&W"b3#´ÖVçT÷&FW"b3#µ7F'BÖVçS"gV÷C² 66Rb33cµ3b²6B6ævW  'VåvBgV÷C²b3#²b3#·6W'fW"b3#¶ç7FÆÂb3#·6F6ævRb3#¶æWw6BæWRgV÷C² 66Rb33cµ3r²÷Vâ÷vW"Gf@ 'VåvBgV÷C´3¢b3#µ&öw&ÒfÆW2b3#´7&W$Ææ²b3#µ÷vW$EdBb3#µ÷vW$EdBæWRgV÷C² 66Rb33cµ3²÷VâFWf6RÖævW  'VåvB77FVÔF"fײgV÷C²b3#¶ÖÖ2æWRgV÷C²fײ77FVÔF"fײgV÷C²b3#¶FWfÖv×Bæ×62gV÷C² 66Rb33cµ3²6ÆV"&V6VçBFö7VÖVçG0 fÆTFVÆWFRW6W%&öfÆTF"fײgV÷C²b3#·&V6VçBgV÷C² ×6t&÷CbÂgV÷C´6ÆV"&V6VçBFö72gV÷C²ÂgV÷Cµ&V6VçBFö7VÖVçG2FVÆWFVBgV÷C² 66Rb33cµ3²FVÆWFR'&÷w6ær7F÷' b7G&ætÆVgBfÆTvWEfW'6öâ&öw&ÔfÆW4F"fײgV÷C²b3#´çFW&æWBWÆ÷&W"b3#¶WÆ÷&RæWRgV÷C²ÂÒgV÷C³rgV÷C²FVà 'Vâb33¶6öçG&öÂæWF7Âæ7Âb33² våvBb33´çFW&æWB&÷W'FW2b33² 6öçG&öÄ6Æ6²b33´çFW&æWB&÷W'FW2b33²Âb33²b33²Âb33´'WGFöãBb33² våvBb33´FVÆWFR'&÷w6ær7F÷'b33² 6öçG&öÄ6Æ6²b33´FVÆWFR'&÷w6ær7F÷'b33²Âb33²b33²Âb33´'WGFöãb33² våvBb33´FVÆWFRfÆW2b33² 6öçG&öÄ6Æ6²b33´FVÆWFRfÆW2b33²Âb33²b33²Âb33´'WGFöãb33² våvBb33´FVÆWFR'&÷w6ær7F÷'b33² 6öçG&öÄ6Æ6²b33´FVÆWFR'&÷w6ær7F÷'b33²Âb33²b33²Âb33´'WGFöãrb33² våvBb33´çFW&æWB&÷W'FW2b33² 6öçG&öÄ6Æ6²b33´çFW&æWB&÷W'FW2b33²Âb33²b33²Âb33´'WGFöã"b33² VÇ6Tb7G&ætÆVgBfÆTvWEfW'6öâ&öw&ÔfÆW4F"fײgV÷C²b3#´çFW&æWBWÆ÷&W"b3#¶WÆ÷&RæWRgV÷C²ÂÒgV÷C³bgV÷C²FVà 'Vâb33¶6öçG&öÂæWF7Âæ7Âb33² våvBb33´çFW&æWB&÷W'FW2b33² 6öçG&öÄ6Æ6²b33´çFW&æWB&÷W'FW2b33²Âb33²b33²Âb33´'WGFöãrb33² våvBb33´FVÆWFRfÆW2b33² 6öçG&öÄ6Æ6²b33´FVÆWFRfÆW2b33²Âb33²b33²Âb33´'WGFöãb33² våvBb33´FVÆWFRfÆW2b33² 6öçG&öÄ6Æ6²b33´FVÆWFRfÆW2b33²Âb33²b33²Âb33´'WGFöã"b33² våvBb33´çFW&æWB&÷W'FW2b33² 6öçG&öÄ6Æ6²b33´çFW&æWB&÷W'FW2b33²Âb33²b33²Âb33´'WGFöãRb33² VÇ6P W@ VæD` 66Rb33cµ3²÷VâæW&ò'W&æær&öÐ 'VåvBgV÷C¶3¢b3#·&öw&ÒfÆW2b3#¶æW&òb3#¶æW&òrb3#¶æWB7F'G6Ö'Bb3#¶æW&÷7F'G6Ö'BæWRgV÷C² 66Rb33cµ3"²÷VâçFW&æWBWÆ÷&W  'VåvBgV÷C´3¢b3#µ&öw&ÒfÆW2b3#´çFW&æWBWÆ÷&W"b3#¶WÆ÷&RæWRGG¢ò÷wwrævöövÆRæ6öÒògV÷C² 66Rb33cµ5ô6ÆVåW fÆTFVÆWFRW6W%&öfÆTF"fײgV÷C²b3#´FW6·F÷b3#·6ögGv&RæÆæ²gV÷C² &VtFVÆWFRgV÷C´´UôÄô4ÅôÔ4äRb3#µ4ôeEt$Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#µ'VâgV÷C²ÂgV÷Cµ6ögG6WGWgV÷C² fÆTFVÆWFRgV÷C¶3¢b3#¶×7WFFRæWRgV÷C² &ö6W746Æ÷6RgV÷C¶WÆ÷&W"æWRgV÷C² 6ÆVW 'VâgV÷C¶WÆ÷&W"æWRgV÷C² 6ÆVW3 vä6Æ÷6RgV÷C´×Fö7VÖVçG2gV÷C²ÂgV÷C²gV÷C² ×6t&÷CbÂgV÷C´6ÆVçWgV÷C²ÂgV÷Cµ26ÆVçW6ö×ÆWFVBgV÷C² 66Rb33c´TDõõ%Tà b33c´TDó"ÒuT7G&Å&VBb33c´TDó FƲb33c´TDó" 66Rb33c´uTôUdTåEô4Äõ4P W@ 66Rb33c´WC0 W@¢VæE7vF6¥tVæ
Edited by Tripredacus

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×