Library/Command/Function involved:PureBasic 5.30 Beta 9 (Linux - x86)
Distro: elementary OS: 0.2.1 "Luna"(32-bit)
Based on: Ubuntu 12.04("Precise")
Intel Core 2 CPU 6300 @ 1.86ghz x 2
Memory: 2gb
Symptom:Library: Clipboard
Command: GetClipboardText()
Example Code:Continuously polling the clipboard with GetClipboardText() in a loop, with or without any time delay eventually causes program to lag and eventually stall for undesirable amounts of time. Amount of time until effect took place varied from a few minutes to 10 minutes.
Code: Select all
OpenWindow(0,60,60,220,200,"Clipboard Bug?",#PB_Window_SystemMenu|#PB_Window_TitleBar)
TextGadget(0,10,10,290,30,"0")
ListViewGadget(1,10,50,200,140)
vClipBoardData$ = GetClipboardText()
; ----------------------------------
Repeat
vWindowEvent = WindowEvent()
Delay(100)
vClipBoardDataTemp$ = GetClipboardText()
If vClipBoardDataTemp$ <> vClipBoardData$
vClipBoardData$ = vClipBoardDataTemp$
AddGadgetItem(1,0,vClipBoardData$)
EndIf
SetGadgetText(0,Str(ElapsedMilliseconds()))
Until vWindowEvent = #PB_Event_CloseWindow
Best regards,I do not have any other systems to test this on or against, so I can't confirm if it's a system specific issue. But, doing the same exact thing in another language I used to use under Wine doesn't suffer from this.. I don't have any other Linux based programming languages to test with right now either or I would have.
I actually have written this code several times using different coding styles, Goto, Gosub, Function, Procedure and just right in the repeat loop as well, all with the same results. I also let the code run while I was interacting with other programs as well as let it run without my interaction with anything else at all and the results were the same. What I didn't try was clearing the clipboard to see if the effect would still happen with an empty clipboard.
What I was trying to accomplish is to keep an eye on the clipboard for text, which was to be the title of software, test that text with a regex against a small database file of software titles to see if the title existed already in the database.
~Garrett