-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMPWHTMLRenderScheme.m
46 lines (39 loc) · 1.16 KB
/
MPWHTMLRenderScheme.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// MPWHTMLRenderScheme.m
// ObjectiveHTTPD
//
// Created by Marcel Weiher on 11/21/11.
// Copyright (c) 2012 Marcel Weiher. All rights reserved.
//
#import "MPWHTMLRenderScheme.h"
#import "WAHtmlRenderer.h"
#import "MPWHtmlPage.h"
@class MPWBinding;
@implementation MPWHTMLRenderScheme
-renderer
{
// FIXME: the retain here shouldn't be necessary, but without it,
// this crashes under GNUstep
return [[WAHtmlRenderer stream] retain];
}
-at:(MPWReference*)aReference
{
@synchronized(self) {
id result=[[self source] at:aReference];
if ( [result isKindOfClass:[MPWHtmlPage class]] ) {
@autoreleasepool {
WAHtmlRenderer* renderer = [self renderer];
@autoreleasepool {
[renderer writeObject:result];
}
result = [renderer result];
[result retain];
// NSLog(@"will pop -[%@ objectForReference: %@",self,aReference);
}
[result autorelease];
}
// NSLog(@"did pop -[%@ objectForReference: %@ -> %@",self,aReference,result);
return result;
}
}
@end