Murga-Projects Forums

Full Version: Segmentation Fault w/browser or text_editor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I also get Bus Errors, but that maybe have been fixed.
I'll attach the docs and crash logs.

This is basically Tobi's original code, and it works in the console and script editor,
but I can't make it work here, it was sent by the level1Clicked function below.

Code:
function fillRawData(...)
    local str=""
    local i=1
    while arg[i]~= nil do
        if str=="" then
            str=tostring(arg[i])
        else
            str=str.."    "..tostring(arg[i])
        end
        i=i+1
    end
    local l_offset=#rawData_buf:text()
    rawData:insert_position(l_offset)
    rawData:insert(str.."\n")
    rawData:show_insert_position()
    rawData:textfont(4)
    rawData:textsize(10)
    
end


It segfaults all the time. So I tried several hacks, all bad, this latest:

Code:
function level1Clicked(w)
if w:value()>0 then    
    rawData:clear()
    rawData_buf:text("")
    
-- a number index to func name and docs data
funN=documentation.found[w:value()]

    if funN ~= nil then
    -- a string from the table
    docs=documentation.doc[funN]
        if docs ~= nil then  rawData:insert(docs.."\n") end
    end
end
end  -- level1Clicked


Works the first click, second click = Segfault

Any clues?

Reference URL's