cleanup memory for scrollarea

Adds basic format
This commit is contained in:
Atul R 2020-03-22 11:08:51 +01:00
parent e0dad876ec
commit c499645797
3 changed files with 9 additions and 3 deletions

View File

@ -23,7 +23,10 @@ Napi::Object QScrollAreaWrap::init(Napi::Env env, Napi::Object exports) {
NScrollArea* QScrollAreaWrap::getInternalInstance() { return this->instance; }
QScrollAreaWrap::~QScrollAreaWrap() { extrautils::safeDelete(this->instance); }
QScrollAreaWrap::~QScrollAreaWrap() {
extrautils::safeDelete(this->instance);
YGNodeFree(this->scrollNode);
}
QScrollAreaWrap::QScrollAreaWrap(const Napi::CallbackInfo& info)
: Napi::ObjectWrap<QScrollAreaWrap>(info) {

View File

@ -1,6 +1,5 @@
import { EventEmitter } from 'events';
import { NativeElement, Component, NativeRawPointer } from './Component';
import { wrapWithActivateUvLoop } from '../utils/helpers';
function addDefaultErrorHandler(native: NativeElement, emitter: EventEmitter): void {
native.subscribeToQtEvent('error');
@ -39,7 +38,7 @@ export abstract class EventWidget<Signals extends {}> extends Component {
super();
if (native.initNodeEventEmitter) {
this.emitter = new EventEmitter();
this.emitter.emit = wrapWithActivateUvLoop(this.emitter.emit.bind(this.emitter));
this.emitter.emit = this.emitter.emit.bind(this.emitter);
native.initNodeEventEmitter(this.emitter.emit);
} else {
throw new Error('initNodeEventEmitter not implemented on native side');

View File

@ -41,6 +41,10 @@ module.exports = {
label: 'Spectrum',
href: 'https://spectrum.chat/nodegui',
},
{
label: 'Slack',
href: 'https://nodegui.slack.com',
},
{
label: 'Twitter',
to: 'https://twitter.com/node_gui',