S
shadowno
Unregistered / Unconfirmed
GUEST, unregistred user!
对象的创建和释放!!,为什么我在释放我的对象时总是显示内存错误??在线等。。
内有代码!!
type
Tql = class(Tobject)
private
ks: array[0..1]of char;
ml: array[0..1]of char;
public
function Read():smallint;
function make(hexstrchar):smallint;
end;
function Tql.Read():smallint;
begin
........
...
end;
function Tql.make(hexstrchar):smallint;
begin
....
..
end;
////////////////////////////////////
其他单元在引用是如下。
procedure Tfsell.ToolButton3Click(Sender: TObject);
var userQL:Tql
begin
userQL:=Tql.create;
....
....
...
userQL.free;
fsell.close;
end;
而且该错误是在退出ToolButton3Click事件时发生的.错误信息为:
project gasman.exe raised exception class EAccessViolation with message'Access
Violation at Address 00000000.read of address 00000000'.Process stopped.Use Step
or Run to continue.
该怎样优化我的这一小段代码?我对对象操作不熟,请多指教,谢谢!!!
内有代码!!
type
Tql = class(Tobject)
private
ks: array[0..1]of char;
ml: array[0..1]of char;
public
function Read():smallint;
function make(hexstrchar):smallint;
end;
function Tql.Read():smallint;
begin
........
...
end;
function Tql.make(hexstrchar):smallint;
begin
....
..
end;
////////////////////////////////////
其他单元在引用是如下。
procedure Tfsell.ToolButton3Click(Sender: TObject);
var userQL:Tql
begin
userQL:=Tql.create;
....
....
...
userQL.free;
fsell.close;
end;
而且该错误是在退出ToolButton3Click事件时发生的.错误信息为:
project gasman.exe raised exception class EAccessViolation with message'Access
Violation at Address 00000000.read of address 00000000'.Process stopped.Use Step
or Run to continue.
该怎样优化我的这一小段代码?我对对象操作不熟,请多指教,谢谢!!!