我遇到了与我的PApplet
对象相关的相当重要的内存问题。我相信,我是destroy()
和stop()
,但每次打电话给PApplet
时,对象记忆都会继续增加。
任何帮助,找出为什么会受到赞赏。
以下是我的程序层次结构:
// This button is component of MAIN JFRAME
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
TechnicPicForm tech=new TechnicPicForm ();
tech.setVisible(true);
}
public class TechnicPicForm extends javax.swing.JFrame {
private createHexMirror crm;
/**
* Creates new form ResultForm
*/
public TechnicPicForm() {
crm = new createHexMirror(12,4.3,324,45,1);
crm.init();
this.setIconImage(new ImageIcon("images/logokanat.png").getImage());
initComponents();
jPanel1.add(crm);
}
@SuppressWarnings("unchecked")
Generated Code
------------Code for Init Components-------------
---------------------------------------------------------------
private void formWindowClosing(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
crm.destroy();
}
}
import processing.pdf.*;
import processing.core.*;
public class createHexMirror extends PApplet {
private float outC,littlePipeC,triangleLine,mirrorC ;
private int mode;
public createHexMirror(float outC, float littlePipeC , float triangleLine, float mirrorC , int mode) {
this.outC= outC;
this.littlePipeC = littlePipeC ;
this.triangleLine= triangleLine;
this.mirrorC = mirrorC;
pmode = mode;
}
@Override
public void setup() {
noLoop();
size(1000, 650);
background(255);
}
public void draw() {
----------------SOME DRAW CODES------------------------
}
}