Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: PyroScriptび「 v2.0

  1. #11

    PyroScriptび「 v2.0

    Quote Originally Posted by Pyrogine
    Did you get my mail?
    no
    From brazil (:

    Pascal pownz!

  2. #12

    PyroScriptび「 v2.0

    Code:
    function Py_Eval(const module, com, resultformat: string; const resultvalue: array of Pointer): Boolean;
    var
      pModule, pDict, pResult: PPyObject;
    begin
      Result := False;
      pModule := PyImport_ImportModule(PChar(module));
      if PyModule_Check(pModule) then
      begin
        pDict := PyModule_GetDict(pModule);
        if PyDict_Check(pDict) then
        begin
          pResult := PyRun_String(PChar(com), eval_input, pDict, pDict);
          if Assigned(pResult) then
          begin
            if PyArg_Parse&#40;pResult, PChar&#40;resultformat&#41;, resultvalue&#41; <> 0 then
              Result &#58;= True;
            Py_DECREF&#40;pResult&#41;;
          end;
          Py_DECREF&#40;pDict&#41;;// ERROR HERE, WHY ? Don't Know!
        end;
        Py_DECREF&#40;pModule&#41;;
      end;
    end;
    im getting crazy with this stuff =.=

    i tested exactly same code on C++ and works perfectly :roll:
    From brazil (:

    Pascal pownz!

  3. #13

    PyroScriptび「 v2.0

    no
    Hmm... check your spam filter maybe?


    im getting crazy with this stuff =.=

    i tested exactly same code on C++ and works perfectly :roll:
    Sweet!
    Jarrod Davis
    Technical Director @ Piradyne Games

  4. #14

    PyroScriptび「 v2.0

    Quote Originally Posted by Pyrogine
    no
    Hmm... check your spam filter maybe?
    its not there ;/

    Quote Originally Posted by Pyrogine
    im getting crazy with this stuff =.=

    i tested exactly same code on C++ and works perfectly :roll:
    Sweet!
    i expressed myself wrong :lol:

    it's bad, i don't know why im getting an error when dec dicts reference count :x
    Code:
    Py_DECREF&#40;pDict&#41;;// ERROR HERE, WHY ? Don't Know!
    From brazil (:

    Pascal pownz!

  5. #15

    PyroScriptび「 v2.0

    oh... ok. Hmmm.. let me see then... maybe the call to PyRun_String. I have no idea how it works. I see you pass pDict in twice? is that correct? Also maybe it does something to the ref count after it returns? What happens to ref count of pDict if PyRun_String fails?
    Jarrod Davis
    Technical Director @ Piradyne Games

  6. #16

    PyroScriptび「 v2.0

    Quote Originally Posted by Pyrogine
    oh... ok. Hmmm.. let me see then... maybe the call to PyRun_String. I have no idea how it works. I see you pass pDict in twice? is that correct? Also maybe it does something to the ref count after it returns? What happens to ref count of pDict if PyRun_String fails?
    a guy from google python group explained me the problem that is "borrowed" value, i must not dec it reference count and PyModule_GetDict returns a a borrowed value :?

    all solved
    From brazil (:

    Pascal pownz!

  7. #17

    PyroScriptび「 v2.0

    Ah, good news.
    Jarrod Davis
    Technical Director @ Piradyne Games

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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