var
  appicon:hicon;
begin
  appicon:=extracticon(hinstance,ExeFile,0);
end;
请问如何把appicon释放掉

解决方案 »

  1.   

    没有!那是java的提法,在delphi中只能手动释放空间,你用appicon=null应该就把它从内存中释放掉了!:)
      

  2.   

    怪,appicon 是hicon类型 不需要释放阿。hicon好像是个无符号长整形。
    比如
    var
     i:integer;
    begin
      i:=4*3;
    end;i需要释放吗?---不晓得对不对:)
      

  3.   

    呵。
    目前只有JAVA有垃圾回收
      

  4.   

    看如下:
    var AList     :TList ;
        nCounter  :Integer ;.....
    procedure XGetMem(var p:Pointer;size:Integer) ;
    begin
      GetMem(p,size) ;
      aList.Add(p) ; 
    end;
    ....
    function callee:PChar ;
    var yourstr:string ; // which one you want return it's content to caller
    begin
      yourstr := 'God it is too bad' ;
      try
        XGetMem(result,length(yourstr)+1) ; // use XGetMem instead of default one
      except
        result := nil ;
      end ;  if assigned(result) then begin
        StrPLCopy(result,yourstr,length(yourstr)) ;
        result[length(yourstr)] := #0;
      end ;
    end ;....
    ....
    ....initialization
      AList:=TList.Create ; // corrected it,:)
    finalization
      while nCounter < AList.Count do
      begin
        freemem(aList.Items[nCounter]) ;
        inc(nCounter) ;
      end;
      AList.Clear ;
      AList.Free ;
    end.
    是否为垃圾回收呢!
      

  5.   

    我认为,DELPHI中一些变量在调用这些变量的程序结束时,也同时被系统自动释放了,但是一些引用变量(例如动态创建的TQUERY等)就必须手动清除。